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.

...

Sommaire
minLevel3
exclude.*Disclaimer.*

GET {url}/localtrac/

locations

location/<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

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

  • If there is no key provided for a specific day of the week, this means the day is closed

  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple

interval
  • intervals can be provided.

    Bloc de code
    "sunday": [
          {
            "start": "08:00",
            "end": "12:00"
          },
          {
            "start": "13:00",
            "end": "23:00"
          }
        ],

GET {url}/localtrac/

locations

location/<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

Bloc de code
languagejson
{
  "2020-10-20": [
    {
      "start": <DateTime H:i>,
      "end": <DateTime H:i>
    }
  ],
  (...)
}

<day>

Each row

represent

represents 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

Bloc de code
languagejson
{ "2020-10-20": [

The change will only apply to normal business hours and not to additional business hours.

  • If null values is provided, this means the day is closed

    Bloc de code
    "2021-07-01": [ 
          {
            "start": null,
    
<DateTime
  •  
H:i>,
  •        "end": 
<DateTime
  • null
     
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.

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

Bloc de code
languagejson
{ "schedules"
  •  ],
  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple intervals can be provided.

    Bloc de code
    "2021-07-01": [
          {
            "start": "08:00",
            "end": "12:00"
          },
          {
            "start": "13:00",
            "end": "23:00"
          }
        ],
  • If you want to delete a schedule exception

    Bloc de code
    "2021-07-01": [],

POST {url}/localtrac/location/<location_uuid>/scheduleexceptions

This route will add/update the schedule exception for each given day provided.

The change will only apply to normal business hours and not to additional business hours.

  • If null values is provided, this means the day is closed

    Bloc de code
    "2021-07-01": [ 
       
{
  •    
"schedule":
  • {
            "
sunday
  • start": 
[
  • null,
            "end": null
    
{
  •       }
       
"start": "00:00",
  • ],
  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple intervals can be provided.

    Bloc de code
    "2021-07-01": [
          {
            "
end
  • start": "
24
  • 08:00",
            "end": "12:00"
    
}
  •       },
      
]
  •     
  • {
     
},
  •        "
scheduleType
  • start": "
4dc8cea0-5e75-4a2a-8ea3-6a1ae195861e" }
  • 13:00",
        
{
  •     
  • "
schedule
  • end":
{
  •  
"monday": [
  • "23:00"
          }
        
{
  • ],
  • If you want to delete a schedule exception

    Bloc de code
    "2021-07-01": [],

Request

Headers

Authorization

<token> obtained during the Authentication

Accept

application/json

Content-Type

application/json

Body

Bloc de code
languagejson
{
  "2020-10-20": [
    {
      "start": 
"00:00",
<DateTime H:i>,
      
"end": 
"24:00"
<DateTime H:i>
    }
  ],
  
}
/** this will delete a schedule exception for this 
],
date **/
  "
tuesday
2020-12-31": [],
  
{ "start": "00:00", "end": "24:00" } ], "thursday": [ { "start": "00:00", "end": "24:00" }
(...)
}

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 error message, indicating that an error occured 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 {url}/localtrac/location/<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

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

  • This route returns an array of schedules.

  • Each element of the array represents a schedule of a specific type.

  • If the “scheduleType” has a null value, then this schedule is the list of the location’s regular opening hours.

  • Each row of a specific schedule represents a day of the week. This row contains an array of intervals representing the opening hours of that day.

  • If there is no key provided for a specific day of week, this means the day is closed

  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple intervals can be provided.

    Bloc de code
         {
          "schedule": {
            "monday": [
              {
                "start": "00:00",
                "end": "24:00"
              }
            ],
            "thursday": [
              {
                "start": "00:00",
                "end": "24:00"
              }
            ]
          },
          "scheduleType": null
        }

POST {url}/localtrac/location/<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 (Example)

Bloc de code
languagejson
{
  "schedules": [
    {
      "schedule": {
        "sunday": [
          {
            "start": "00:00",
            "end": "24:00"
          }
        ],
        "saturday": [
          {
            "start": "00:00",
            "end": "24:00"
          }
        ]
      },
      "scheduleType": null
    },
    {
      "schedule": {
        "thursday": [
          {
            "start": "00:00",
            "end": "24:00"
          }
        ]
      },
      "scheduleType": "cc9396e6-c979-4359-bf47-2ab8a2084d54"
    }
  ]
}

Schedule (optional)

An associative array where each key is one day of the week. The value of each key is a range of opening hours with “start” and “end” key for each period within a day. The sub array allows multiple values since a day can be opened and closed multiple times per day.

  • If the key “scheduleType” has a null value, then this schedule will be applied to the location’s regular opening hours.

  • If there is no key provided for a specific day of week, this means there won’t be any action performed (data in LOCALTRAC will remain unchanged)

  • If nothing is provide for a day, this means the day is closed

    Bloc de code
        {
          "schedule": {
            "thursday": []
    	  },
          "scheduleType": null
        }
  • If array with “start: null” and “end: null” is provided, this means the day is closed

    Bloc de code
        {
          "schedule": {
            "thursday": [
              {
                "start": null,
                "end": null
              }
            ]
    	  },
          "scheduleType": null
        }
  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple interval can be provided.

    Bloc de code
        "schedule": {
            "thursday": [
                    {
               
]
  •        
}
  • "start": "08:00",
          
"scheduleType": null
  •             "end": "12:00"
         
},
  •      
{
  •       },
    
"schedule":
  •  
{
  •          
"wednesday":
  •  
[
  •      {
         
{
  •              "start": "
00
  • 13:00",
                      "end": "
24
  • 23:00
"
  • "
                    }
            
],
  •     ]
    	  },
     
"friday":
  •  
[
  •     "scheduleType": "cc9396e6-c979-4359-bf47-2ab8a2084d54"
        
{
  • }
  • If no keys are provided, the schedule will be deleted. (Not applicable to regular schedule when "scheduleType" is null. All days will be closed for the regular schedule.)

    Bloc de code
        {
          
  • "
start
  • schedule": 
"00:00"
  • {},
          
"end
  • "scheduleType": "
24:00"
  • c7871a5a-a651-4a05-8b07-74a42b4548ef"
        
} ] }, "scheduleType": "3f135e89-a911-4753-a244-37a44e427481" }, { "schedule": { "saturday": [ { "start": "00:00", "end": "24:00" } ] }, "scheduleType": "db37e0e6-b5e8-4fa5-a3cc-2b25f419646b" } ] }

<schedule>

  • This route returns an array of schedules.

  • Each element of the array represents a schedule of a specific type.

  • If the “scheduleType” has a null value, then this schedule is the list of the location’s regular opening hours.

  • Each row of a specific schedule represents a day of the week. This row contains an array of intervals representing the opening hours of that day.

  • If there is no key provided for a specific day of week, this means the day is closed

  • If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple interval can be provided.

    Bloc de code {

    Response (200) - Success

    Headers

    Content-type

    application/json

    Cache-Control

    no-cache,private

    Body

    Bloc de code
    languagejson
    {
      "schedules": "Schedules updated"
    }

    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": {
        "schedules.1.schedule.thursday.0.start": "Start hour cannot be higher than end hour"
      }
    }

    message

    Always the same error message, indicating that an error occured 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 {url}/localtrac/schedules

    This route will return the list of custom schedule types.

    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

    Bloc de code
    languagejson
    {
      "schedules": [
        {
          "uuid": "db37e0e6-b5e8-4fa5-a3cc-2b25f419646b",
          "
    schedule
    name": {
            "
    monday
    en": 
    [
    "Access",
            "fr": "Accès"
    
    {
          }
        
    "start": "00:00"
    },
        
    {
          "
    end
    uuid": "
    24:00"
    f8c24729-09ff-4f97-8499-e83f4d429860",
          "name": {
      
    }
          
    ]
    "en": "Brunch",
            "
    thursday
    fr": 
    [
    "Brunch"
          }
       
    {
     },
        {
          "
    start
    uuid": "
    00:00
    4dc8cea0-5e75-4a2a-8ea3-6a1ae195861e",
          "name": {
            "
    end
    en": "
    24:00
    Delivery",
            "fr": "Livraison"
    
    }
          }
      
    ]
      },
        
    },
    {
          "
    scheduleType
    uuid": 
    null
    "c7871a5a-a651-4a05-8b07-74a42b4548ef",
          
    }

    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

    Bloc de code
    languagejson
    { "schedules": [ {
    "name": {
            "en": "Drive through",
            "fr": "Service de drive"
          }
        },
        {
          "uuid": "fcbccfd9-0fb1-4b6b-b885-cd510239aa6e",
          "
    schedule
    name": {
            "
    sunday
    en": 
    [
    "Happy hours",
            
    {
    "fr": "Happy hours"
          }
        
    "start": <DateTime H:i>
    },
        
    {
          "
    end
    uuid": 
    <DateTime H:i>
    "cc9396e6-c979-4359-bf47-2ab8a2084d54",
          "name": {
     
    }
           
    ]
    "en": "Kitchen",
            "
    saturday
    fr": 
    [
    "Cuisine"
          }
       
    {
     },
        {
          "
    start
    uuid": 
    <DateTime H:i>,
    "6ab63443-bc4a-4eed-9d8e-4941c3e3650f",
          "
    end
    name": 
    <DateTime
    {
    
    H:i>
            
    }
    "en": "Online service hours",
       
    ]
         "fr": "Service 
    },
    en ligne"
         
    "scheduleType":
     
    null
    }
        },
        {
          "
    schedule
    uuid": 
    {
    "bc8fef33-30fd-40bb-aebb-17b2f37b1f6d",
          
    "
    thursday
    name": 
    [
    {
            "en": "Pickup",
    
    {
            
    "
    start
    fr": 
    <DateTime H:i>,
    "Retrait"
          }
        },
     
    "end":
     
    <DateTime
     
    H:i>
     {
          "uuid": "d1806e01-a471-45a7-9739-54db5e1b3f37",
     
    }
         "name": {
      
    ]
          
    }
    "en": "Takeout",
            "
    scheduleType
    fr": "
    cc9396e6-c979-4359-bf47-2ab8a2084d54"
    Vente à emporter"
          }
        },
      
    ] }

    Response (200) - Success

    Headers

    Content-type

    application/json

    Cache-Control

    no-cache,private

    Body

    Bloc de code
    languagejson
      {
          "
    schedules
    uuid": "
    Schedules updated" }

    Response (400) - Validation Error

    Headers

    Content-type

    application/json

    Cache-Control

    no-cache,private

    Body

    Bloc de code
    languagejson
    {
    3f135e89-a911-4753-a244-37a44e427481",
          "
    message
    name": {
      
    "Provided
     
    data
     
    contains
     
    error(s).
     
    See
     
    each
     
    entry in [errors]
    "en": "Senior hours",
      
    "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
          "fr": "Horaires pour les seniors"
          }
        }
      ]
    }

    <schedule type>

    • Each row represents a specific custom schedule type. The “uuid' key is a unique id of a custom schedule type.

    • The “name” key contains the English and French version of the name for this schedule type.