getAppSlots API

Follow

Summary

Requirements

All API calls require a dedicated JSON Web Token (JWT). These are created when a user with a dedicated mobile resource logs in to the application. If you are using the API for programmatic queries, it is best to create a dedicated user for the JWT as this gets reset each time the user logs in.

Endpoint

/rest/availability/getAppSlots/{jobRef}/{startDate}/{params}

GET

Returns a list of available appointment slots for the given job reference, taking the start date an optional parameters to filter availability.

Parameters

Available parameters are:

  • allowSecondary - Boolean
    • true returns results for resources using secondary service cover
  • zoneCriteria - Character
    • Primary - Only allow primary postcode coverage
    • Both - Allow primary and secondary postcode coverage
    • Any - Postcode coverage is not used as a determining factor

Example request

https://app.oneserve.co.uk/siteUrl/rest/availability/getAppSlots/J01234/24-Jul-2020/?allowSecondary=true&zoneCriteria=Both

Response Format Spec

 

Available Response Fields
Field Name Data Type Description
available Array An array of available appointment slots
date Date The date of the appointment slot
slot Array An array of available day divisions

 

Available Response Representations

HTTP Code Description Schema
200 Apppointments available [Array]
400 Bad Request Error
401 Unauthorized Error
403 Forbidden Error
404 Address Not Found Error
405 Method Not Allowed Error
500 Internal Server Error Error

 

Example JSON Response
{
    "root": {
        "available": [
            {
                "slot": [
                    "AM",
                    "All Day",
                    "PM"
                ],
                "date": "27/07/2020"
            },
            {
                "slot": [
                    "AM",
                    "All Day",
                    "PM"
                ],
                "date": "28/07/2020"
            },
            {
                "slot": [
                    "AM",
                    "All Day",
                    "PM"
                ],
                "date": "29/07/2020"
            }
        ]
    }
}
Example XML Response
<root>
    <available>
        <date>27/07/2020</date>
        <slot>AM</slot>
        <slot>All Day</slot>
        <slot>PM</slot>
    </available>
    <available>
        <date>28/07/2020</date>
        <slot>AM</slot>
        <slot>All Day</slot>
        <slot>PM</slot>
    </available>
    <available>
        <date>29/07/2020</date>
        <slot>AM</slot>
        <slot>All Day</slot>
        <slot>PM</slot>
    </available>
</root>

 

Troubleshooting

 

401 Unauthorized

Response

401 Unauthorized

Reason

This error occurs if the OS-REST-AUTH-TOKEN has not been provided, has expired, or does not exist in the system

Resolution

Verify your OS-REST-AUTH-TOKEN with support

403 Forbidden

Response

403 Forbidden

Reason

This error indicates that something is blocking your connection to the server

Resolution

Open a ticket with the support team with details of your connection so that your access can be verified

404 Not Found

Response

404 Not Found

Reason

This error should only occur if the endpoint has been mistyped in some way, which will lead the call to an endpoint that does not exist

Resolution

Verify the endpoint matches the value specified in this article

405 Method Not Allowed

Response

405 Method Not Allowed

Reason

This error will occur if an unacceptable method has been used in the call such as POST or DELETE

Resolution

Ensure that you are using a GET call to this endpoint