Web Slots |
Top Previous Next |
Onyx Garage WebSlots API V1
WebSlots allow a third party application to query the available diary slots and to make new diary entries. This will be useful for MOT and Service bookings on a remote website. To use this service you must first create a new user in Onyx that has the 'WebSlots API' permission. Headers All calls to the WebSlots Api must have the following headers: UserName – URL Encoded username (set in Onyx Desktop) Password – URL Encoded password (set in Onyx Desktop) Version – The version of the API that you are using (currently 1) URL The Rest service will be hosted on a webserver running on the master PC. Therefore the URL is the WAN IP of that PC. Port forwarding will be needed to make the service available to external applications. The service uses a self signed SSL certificate. Response A valid response is indicated by a http status of 200/201. Errors will be returned as Application/Json as per the following example: {"ErrorCode":404,"ErrMsg":"No such service, please check API documentation"}
Get WebSlots Provides a list of slots for the date requested. End Point URL/rest/WebSlots Method Get Paramaters Date – ISO8601 date (i.e., 2021-02-19) EndDate - ISO8601 date (i.e. 2021-02-28) - Optional Paramater Example https://111.111.111.111/rest/WebSlots?Date=2021-02-19 https://111.111.111.111/rest/WebSlots?Date=2021-02-19&EndDate=2021-02-28 Returns (success = 200) { "slot":[ { "resourceID":1876479339, "slotStart":"2021-02-22T08:30:00.000Z", "slotEnd":"2021-02-22T09:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T09:30:00.000Z", "slotEnd":"2021-02-22T10:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T10:30:00.000Z", "slotEnd":"2021-02-22T11:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T11:30:00.000Z", "slotEnd":"2021-02-22T12:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T13:30:00.000Z", "slotEnd":"2021-02-22T14:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T14:30:00.000Z", "slotEnd":"2021-02-22T15:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T15:30:00.000Z", "slotEnd":"2021-02-22T16:30:00.000Z", "available":true }, { "resourceID":1876479339, "slotStart":"2021-02-22T16:30:00.000Z", "slotEnd":"2021-02-22T17:30:00.000Z", "available":false } ] }
Get Resource Descriptions Provides a list of resource descriptions. End Point URL/rest/DiaryResource Method Get Example https://111.111.111.111/rest/DiaryResource Returns (Success = 200) { "resource":[ { "resourceID":1876479339, "description":"Mot Ramp", "showHolidays":true, "displayOrder":0 }, { "resourceID":1471011721, "description":"Ramp 1", "showHolidays":false, "displayOrder":1 }, { "resourceID":2016403909, "description":"Ramp 2", "showHolidays":false, "displayOrder":2 } ] }
Book WebSlot Allows you to create a booking for a web slot time period. Note, the request must exactly match an available slot. Slots can be used internally so provision must be made to accommodate a slot becoming unavailable between requesting available slots and booking a slot End Point URL/rest/BookWebSlot Method Post Headers ContentType = “application/json” Body { "resourceID":1876479339, "startDateTime":"2021-02-22T16:30:00.000Z", "endDateTime":"2021-02-22T17:30:00.000Z", "jobDetails":"Web Booking", "vrm":"ABC 123", "customerTitle":"Mx", "customerFirstName":"Sam", "customerSurname":"Person", "customerMobile":"+447777012345", "customerEmail":"a@a.com" }
Example https://111.111.111.111/rest/BookWebSlot Returns (Success = 201) Response Body { "ResultCode":201, "Msg":"Created", "Data":58 }
Note, Data is the JobCard number
|