Skip to main content
You are here:
Print

Advanced Features – REST API

With REST API, you can read and create bookings and services, check available time slots from a remote website using REST protocol.

Read Bookings

Reads all or partial bookings filtered by attributes
Format: GET wp-json/wpbase/v1/bookings/
Attributes: See wpb_get_apps in functions.booking.php file

Create Booking

Create a booking with values given in the attribute
Format: POST wp-json/wpbase/v1/bookings/
Attributes: See wpb_add_booking in functions.booking.php file

Read Booking

Read a single booking
Format: GET wp-json/wpbase/v1/bookings/<id>
Attributes: None

Update Booking

Update a booking with values given in attributes
Format: POST wp-json/wpbase/v1/bookings/<id>
Attributes: See wpb_update_booking in functions.booking.php file

Delete Booking

Delete a booking
Format: DELETE wp-json/wpbase/v1/bookings/<id>
Attributes: None

Read Services

Reads all or partial services filtered by category and internal
Format: GET wp-json/wpbase/v1/services/
Attributes:
order_by (string): Order by clause. Allowed values: sort_order, id, name
exclude_internal (bool): Whether to exclude internal services
category (string|array): Comma delimited ids or array of categories to get the services for

Create Service

Create a service with values given in the attribute
Format: POST wp-json/wpbase/v1/services/
Attributes: See wpb_add_service in functions.booking.php file

Read Service

Read a single service
Format: GET wp-json/wpbase/v1/services/<id>
Attributes: None

Update Service

Update a service with values given in attributes
Format: POST wp-json/wpbase/v1/services/<id>
Attributes: See wpb_update_service in functions.booking.php file

Delete Service

Delete a service
Format: DELETE wp-json/wpbase/v1/services/<id>
Attributes: None

Read Workers

Reads all workers (providers)
Format: GET wp-json/wpbase/v1/workers/
Attributes:
order_by (string): Order by clause. Allowed values: sort_order, id, name

Create Worker

Create a worker (provider) with values given in the attribute
Format: POST wp-json/wpbase/v1/workers/
Attributes: See wpb_add_worker in functions.booking.php file

Read Worker

Read a single worker (provider)
Format: GET wp-json/wpbase/v1/workers/<id>
Attributes: None

Update Worker

Update a worker (provider) with values given in attributes
Format: POST wp-json/wpbase/v1/workers/<id>
Attributes: See wpb_update_worker in functions.booking.php file

Delete Worker

Delete a worker (provider)
Format: DELETE wp-json/wpbase/v1/workers/<id>
Attributes: None

Read Locations

Reads all locations
Format: GET wp-json/wpbase/v1/locations/
Attributes:
order_by (string): Order by clause. Allowed values: sort_order, id, name

Read Clients

Reads all WP BASE clients
Format: GET wp-json/wpbase/v1/clients/
Attributes: None

Read Vendors

Reads all WP BASE vendors
Format: GET wp-json/wpbase/v1/vendors/
Attributes: None

Is Free

Check if a time slot defined in attributes is available
Format: GET wp-json/wpbase/v1/is-free/
Attributes: See wpb_is_free in functions.booking.php file

First Free

Find first free slot for service, worker and/or location defined in attributes
Format: GET wp-json/wpbase/v1/first-free/
Attributes:
location (integer): Location ID
service (integer): Service ID
worker (integer): Worker (Provider) ID

Slots In Day

Find all free slots for a given day and service, worker and/or location defined in attributes
Format: GET wp-json/wpbase/v1/slots-in-day/
Attributes:
location (integer): Location ID
service (integer): Service ID
worker (integer): Worker (Provider) ID
start (integer|string): Timestamp or date in English

Table of Contents