Skip to content

Latest commit

 

History

History
101 lines (77 loc) · 3.4 KB

File metadata and controls

101 lines (77 loc) · 3.4 KB
title Providers
nav_order 8
description API reference for the Makeplans providers endpoint — the link between resources and the services they provide.

Resources provides services. This link is called a provider.

Attributes

NameTypeDescription
idIntegerAutomatically set
created_atDatetimeAutomatically set
updated_atDatetimeAutomatically set
resource_idIntegerRequired
service_idIntegerRequired
opening_hours_monArrayOpening hours for Monday.
opening_hours_tueArrayOpening hours for Tuesday.
opening_hours_wedArrayOpening hours for Wednesday.
opening_hours_thuArrayOpening hours for Thursday.
opening_hours_friArrayOpening hours for Friday.
opening_hours_satArrayOpening hours for Saturday.
opening_hours_sunArrayOpening hours for Sunday.
priority_valueIntegerNot required. Priority value for ordering.

The opening hours format is the same as on resources.

Provider opening hours are only used to generate slots when the service has availability_type set to provider. A null value for a weekday then means the provider is closed on that weekday. When the service has availability_type set to resource (the default), the opening hours on the resource are used and the provider opening hours are ignored.

Opening hours on specific dates for a provider are set with a service scoped resource exception date.

Listing

GET /providers will return all providers for active resources.

Response

[
  {
    "provider": {
      "created_at": "2012-09-20T15:34:16+02:00",
      "id": 1,
      "resource_id": 1,
      "service_id": 1,
      "opening_hours_mon": null,
      "opening_hours_tue": null,
      "opening_hours_wed": null,
      "opening_hours_thu": null,
      "opening_hours_fri": null,
      "opening_hours_sat": null,
      "opening_hours_sun": null,
      "priority_value": null,
      "updated_at": "2012-09-20T15:34:16+02:00"
    }
  }
]

Get provider

GET /providers/{provider_id} will get a provider with id {provider_id}.

Get opening hours for provider

GET /providers/{provider_id}/opening_hours will return the calculated opening hours per date for a provider, including any exception dates.

Query Parameters

NameTypeDescription
fromDateDefault: today
toDateDefault: same as from

Response

[
  {
    "resource_opening_hours": {
      "date": "2015-10-22",
      "opening_hours": ["08:00", "14:00"]
    }
  }
]

Add new provider

POST /providers will create a new provider.

Update provider

PUT /providers/{provider_id} will update existing provider with id {provider_id}.

Delete provider

DELETE /providers/{provider_id} will delete existing provider with id {provider_id}.