Skip to content

Rest API

Joshua Grierson edited this page Oct 26, 2017 · 1 revision

Rest API

The plugin comes with a rest api, which can be used to make ajax calls using javascript to return booking information, this is the better option since it is lighter on our servers and improves site performance.


Booking Types

Endpoint Method Response Type
/wp-json/dmn/v1/bookings/ GET json

Post Booking Info

Endpoint Method Response Type
/wp-json/dmn/v1/booking/ POST json
/wp-json/dmn/v1/booking?details POST json
/wp-json/dmn/v1/booking?submit POST json

Post body in json, could look like example below:

{
  "venue": "venue-id",
  "type": "type-id",
  "num_people": 30,
  "date": "2017-11-10",
  "time": "14:30",
  "duration": 15
}

Passing details as a parameter, will return the booking details.
OR
Passing submit as a parameter, will submit the booking and return web link in response.

Clone this wiki locally