OptimoCMSDocs

Booking

Appointment booking

GET
/v1/sites/{siteId}/booking/slots

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Query Parameters

serviceId*string
date*string
Formatdate
staffId?string
branchId?string

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/booking/slots?serviceId=string&date=2019-08-24"
{
  "data": [
    {
      "startTime": "string",
      "endTime": "string",
      "available": true,
      "staffId": "string"
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
GET
/v1/sites/{siteId}/booking/bookings

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Query Parameters

limit?integer
Default25
Rangevalue <= 100
cursor?string
status?string
date?string
Formatdate

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/sites/string/booking/bookings"
{
  "data": [
    {
      "id": "string",
      "status": "string",
      "date": "string",
      "startTime": "string",
      "customer": {},
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  },
  "pagination": {
    "total": 0,
    "limit": 0,
    "nextCursor": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
POST
/v1/sites/{siteId}/booking/bookings

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/sites/string/booking/bookings" \  -H "Content-Type: application/json" \  -d '{    "serviceId": "string",    "date": "2019-08-24",    "startTime": "string",    "customer": {}  }'
{
  "data": {
    "id": "string",
    "status": "string",
    "date": "string",
    "startTime": "string",
    "customer": {},
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
PATCH
/v1/sites/{siteId}/booking/bookings/{id}/status

Authorization

ApiKeyAuth
X-Api-Key<token>

API key obtained from the CMS dashboard.

In: header

Path Parameters

siteId*string
id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

status*string

Response Body

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/sites/string/booking/bookings/string/status" \  -H "Content-Type: application/json" \  -d '{    "status": "string"  }'
{
  "data": {
    "id": "string",
    "status": "string",
    "date": "string",
    "startTime": "string",
    "customer": {},
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}