Don’t miss our Special Offer!

Up to 50% off
Grab Amelia
Grab Amelia

Amelia API – Search Timeslots

Here you can see API endpoints related to timeslots for the search form.

You can see all the API endpoints with examples of requests and responses in the Amelia API Postman collection which you can download here.

Content

Authorization

All Amelia endpoints use an API key authorization, using the header property named “Amelia”.

Path

Amelia API paths start with: {{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1

Get timeslots

Get timeslots.

Method

This endpoint accepts GET requests.

Path

/search

Query Parameters

You can use the following parameters.

Key Type Description
date string The date to search for timeslots. In the format: “YYYY-MM-DD”. Required.
services array Array of service IDs.
providers array Array of provider IDs.
location integer Location ID.
timeFrom string Time from which to search for timeslots. In the format: “HH:mm:ss”
timeTo string Time until which to search for timeslots. In the format: “HH:mm:ss”
page integer Number of page.
sort string How to sort the services. Possible values: name or price. An empty value will sort services by position in the backend, which is the default behaviour.

Example

curl --location 'http://localhost/amelia/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/search&date=2023-09-27&location=2&page=1&services=1,2&sort=name&providers=1,3' \
--header 'Amelia: qUmkNNOLrWbf28izIgNnZ29O+7gVWL5M+8ySJ8VXq3r0'
{
    "message": "Successfully retrieved searched services.",
    "data": {
        "providersServices": [
            {
                "1": 1,
                "places": null,
                "locations": [
                    2
                ],
                "price": 23
            },
            {
                "2": 1,
                "places": null,
                "locations": [
                    2
                ],
                "price": 0
            }
        ],
        "total": 2
    }
}