| 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.
| Name | Type | Description |
|---|---|---|
| id | Integer | Automatically set |
| created_at | Datetime | Automatically set |
| updated_at | Datetime | Automatically set |
| resource_id | Integer | Required |
| service_id | Integer | Required |
| opening_hours_mon | Array | Opening hours for Monday. |
| opening_hours_tue | Array | Opening hours for Tuesday. |
| opening_hours_wed | Array | Opening hours for Wednesday. |
| opening_hours_thu | Array | Opening hours for Thursday. |
| opening_hours_fri | Array | Opening hours for Friday. |
| opening_hours_sat | Array | Opening hours for Saturday. |
| opening_hours_sun | Array | Opening hours for Sunday. |
| priority_value | Integer | Not 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.
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 /providers/{provider_id} will get a provider with id {provider_id}.
GET /providers/{provider_id}/opening_hours will return the calculated opening hours per date for a provider, including any exception dates.
| Name | Type | Description |
|---|---|---|
| from | Date | Default: today |
| to | Date | Default: same as from |
Response
[
{
"resource_opening_hours": {
"date": "2015-10-22",
"opening_hours": ["08:00", "14:00"]
}
}
]POST /providers will create a new provider.
PUT /providers/{provider_id} will update existing provider with id {provider_id}.
DELETE /providers/{provider_id} will delete existing provider with id {provider_id}.