Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

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

Bloc de code
languagejson
{
  "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

Bloc de code
languagejson
{
  "message": "Schedules exceptions added"
}

Response (400) - Validation Error

Headers

Content-type

application/json

Cache-Control

no-cache,private

Body

Bloc de code
languagejson
{
  "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.

...