Instructions
GET {url}/localtrac/locations/<location_uuid>/schedules | |
---|---|
This route will return the list of the location’s regular opening hours. If one day is different (abnormal), use Schedule Exceptions instead. | |
Request | |
Headers | |
Authorization | <token> obtained during the Authentication |
Accept | application/json |
Response (200) - Success | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "sunday": [ { "start": "00:00", "end": "24:00" }, (...) ], "monday": [ { "start": "00:00", "end": "24:00" }, (...) ], "tuesday": [ { "start": "00:00", "end": "24:00" }, (...) ], "wednesday": [ { "start": "00:00", "end": "24:00" }, (...) ], "thursday": [ { "start": "00:00", "end": "24:00" }, (...) ], "friday": [ { "start": "00:00", "end": "24:00" }, (...) ], "saturday": [ { "start": "00:00", "end": "24:00" } , (...) ] } | |
<day> | Each row represents a day of the week. This row contains an array of intervals representing the opening hours of that day.
|
GET {url}/localtrac/locations/<location_uuid>/scheduleexceptions | |
---|---|
This route will return the list of special opening hours (exceptions) where the opening hours of the location differ from the regular opening hours. | |
Request | |
Query | |
p | <int> Page to obtain |
Headers | |
Authorization | <token> obtained during the Authentication |
Accept | application/json |
Response (200) - Success | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "2020-10-20": [ { "start": <DateTime H:i>, "end": <DateTime H:i> } ], (...) } | |
<day> | Each row represent a specific day where the opening hours differ from the regular opening hours. This row contains an array of intervals representing the opening hours of that day. |
POST {url}/localtrac/locations/<location_uuid>/scheduleexceptions | |
---|---|
This route will add/update the schedule exception for each given day provided. | |
Request | |
Headers | |
Authorization | <token> obtained during the Authentication |
Accept | application/json |
Content-Type | application/json |
Body | |
{ "2020-10-20": [ { "start": <DateTime H:i>, "end": <DateTime H:i> } ], /** this will delete a schedule exception for this date **/ "2020-12-31": [], (...) } | |
Response (200) - Success | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "message": "Schedules exceptions added" } | |
Response (400) - Validation Error | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "message": "Provided data contains error(s). See each entry in [errors]", "errors": { "2020-10-20.0.start": "Start hour cannot be higher than end hour" } } | |
message | Always the same message of error, indicating that an error happened during the validation process |
errors | An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data. If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken. |
GET {{base_url}}/localtrac/location/{uuid}/allSchedules | |
---|---|
This route will return the list of the location’s opening hours. | |
Request | |
Headers | |
Authorization | <token> obtained during the Authentication |
Accept | application/json |
Response (200) - Success | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "schedules": [ { "schedule": { "sunday": [ { "start": "00:00", "end": "24:00" } ] }, "scheduleType": "4dc8cea0-5e75-4a2a-8ea3-6a1ae195861e" }, { "schedule": { "monday": [ { "start": "00:00", "end": "24:00" } ], "tuesday": [ { "start": "00:00", "end": "24:00" } ], "thursday": [ { "start": "00:00", "end": "24:00" } ] }, "scheduleType": null }, { "schedule": { "wednesday": [ { "start": "00:00", "end": "24:00" } ], "friday": [ { "start": "00:00", "end": "24:00" } ] }, "scheduleType": "3f135e89-a911-4753-a244-37a44e427481" }, { "schedule": { "saturday": [ { "start": "00:00", "end": "24:00" } ] }, "scheduleType": "db37e0e6-b5e8-4fa5-a3cc-2b25f419646b" } ] } | |
<schedule> |
|
POST {{base_url}}/localtrac/location/{uuid}/allSchedules | |
---|---|
This route will add/update the schedule for each provided day of each provided schedule type | |
Request | |
Headers | |
Authorization | <token> obtained during the Authentication |
Accept | application/json |
Content-Type | application/json |
Body | |
{ "schedules": [ { "schedule": { "sunday": [ { "start": <DateTime H:i>, "end": <DateTime H:i> } ], "saturday": [ { "start": <DateTime H:i>, "end": <DateTime H:i> } ] }, "scheduleType": null }, { "schedule": { "thursday": [ { "start": <DateTime H:i>, "end": <DateTime H:i> } ] }, "scheduleType": "cc9396e6-c979-4359-bf47-2ab8a2084d54" } ] } | |
Response (200) - Success | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "schedules": "Schedules updated" } | |
Response (400) - Validation Error | |
Headers | |
Content-type | application/json |
Cache-Control | no-cache,private |
Body | |
{ "message": "Provided data contains error(s). See each entry in [errors]", "errors": { "schedules.1.schedule.thursday.0.start": "Start hour cannot be higher than end hour" } } | |
message | Always the same message of error, indicating that an error happened during the validation process |
errors | An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data. If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken. |