This is the API documentation for MakePlans. MakePlans is an online booking application with support for appointments, classes and events. For more information about the application and its features see https://www.makeplans.net.
MakePlans provides a fairly standard REST API. All features in MakePlans are available via the API.
General Information:
- Get started
- Base API URL
- Versioning
- Data formats
- Date handling
- Custom data
- Authentication
- Identification
- Errors
- Pagination
- Examples
- Syncronisation
- Client libraries
- Web hooks
API Endpoints:
- Slots
- Bookings
- People
- Services
- Events
- Resources
- Resource exception dates
- Providers
- Categories
- Users
- Client
-
Sign up for a trial account in our test-environment: http://app.test.makeplans.net/client/new
-
Enable the API and get the API-key from the account page.
-
Read this documentation.
-
Profit.
When your integration is ready to be released then you can sign up for a real account at https://app.makeplans.net/client/new
The base URL is https://youraccount.makeplans.net/api/
for production apps and http://youraccount.test.makeplans.net/api/
for test apps. All requests in the production environment are done over HTTPS. Please note that the staging environment is not encrypted (HTTP only). Each object in MakePlans has its own endpoints.
The current version of the API is version 1. The versioning scheme is as follows: /api/v{version_number}/
. All paths in the rest of the document uses /api/v1/
as base path.
Please keep up to date with the API as older versions may be deprecated.
The API supports JSON and XML for input and output. In addition you can specify input using form data.
The format of the output data is provided as is and the reference is this document. We do not use XML Schema. Any additional attributes such as 'type' in XML must be considered only as hints.
All data is UTF-8.
All examples and object attributes in this documentation are JSON. They are lowercase and use underscore as seperator. XML element names uses hypen instead of underscore (created-at
instead of created_at
).
To specify JSON as output use HTTP-header Accept: application/json
. Output can also be defined by using extension in the path: /resources.json
but it is recommended to use /resources
and specify output format in the HTTP-header. Multiple items is returned as an array.
To specify JSON as input use HTTP-header Content-Type: application/json
. The body must be JSON-formatted and include the object with required attributes.
To use normal form data specify HTTP-header application/x-www-form-urlencoded
. Form values should be sent like this: resource[title]=Unicorn
.
All dates are specified in the ISO 8601 format. Timezone is included in the output and specified by the account. It is not necessary to specify timezone in the input as the account timezone will be used as default. The output will give a full ISO 8601 date format with time zone: YYYY-MM-DDThh:mm:ssTZD
. For input we recommend that you do not specify time zone unless needed and ommit seconds: YYYY-MM-DD hh:mm
.
Custom data is stored as key/value. All values are stored as strings but we do convert boolean values and values from keys ending in '_at' to datetime at output. Custom data can be added to booking, person, service, resource and event. If you are using our standard booking site and would like to store custom data to a new booking please see https://github.com/makeplans/makeplans-custom-forms for details on how to customise the booking form.
Custom data is stored as one attribute. All keys and values must be present when updating. If a booking has stored custom_data
as 'makeplans_is=awesome' and you want to add 'signup=now' then you need to include both 'makeplans_is' and 'signup' with their values.
MakePlans uses HTTP Basic Auth. The client has to enable the API first and you will find the API-Key in the account settings. The API-Key is the username and there is no password. MakePlans uses SSL and all requests over http will be redirected to https.
If your app is installable by end-users you should use oAuth. However we do not yet support oAuth so please contact us if this is something you require.
You must include a User-Agent HTTP-header with the name of your application and a link to it or your email address so we can get in touch in case you're doing something wrong (so we may warn you before you're blacklisted) or something awesome (so we may congratulate you). Example: User-Agent: YourAppName (http://example.com)
.
4xx HTTP status codes means you made a mistake and you need to adjust your request.
Authentication error. Response body will give explanation if there is authorisation issue or if the API is not enabled.
Not yet implemented
Please pay your bill.
API usage error. This means you did something wrong and there should be a message in the body that explains it. Error message is related to specified resource. Fix it and try again.
Example response:
{
"title": [
"is a required field. Cannot be empty"
]
}
Obviously incorrect paths (/cats
) returns 404. However, even though cool URIs should not change, previously available objects, lets say /resources/666
, might have been deleted and thus return a 404 when requested. In most cases deleted resources will be returned and have a booking state or a flag that indicate that the resource is inactive or deleted.
You can perform up to 120 requests per 60 second period from the same IP address. If you exceed this limit, you'll get a 429 Too Many Requests response for subsequent requests. Check the Retry-After
HTTP-header to see how many seconds to wait before retrying the request.
System errors (aka we screwed up) returns 5xx HTTP status codes without any detailed information. We log all system errors, but please contact us if you get this response.
{
"error": "system error"
}
Maximum 100 results are returned per page. Specify page with parameter page
. Pagination is used for: bookings, events, people and resource exception dates. All other objects return all available items. Please note that currently there is no way to specify exact part of the dataset. Thus an item might appear in both page 2 and 3 if the complete dataset for the query has changed.
curl -u APIKEY: \
-H 'User-Agent: YourAppName (http://example.org)' \
-H 'Accept: application/json' \
https://youraccount.makeplans.net/api/v1/services
To create something you have to make a POST:
curl -u APIKEY: \
-H 'User-Agent: YourAppName (http://example.org)' \
-H 'Accept: application/json' \
-d 'service[title]=My new service!&service[interval]=40' \
-X POST \
https://youraccount.makeplans.net/api/v1/services
Syncronising data is hard. Please ensure you test before releasing to production. First pick either MakePlans or the other system as a master. If the other system is chosen as a master then we recommend enabling the 'confirmation by administrator' setting for bookings. The synchronisation should then retrieve unprocessed bookings and process them (confirm/decline). This will ensure you can handle any changes occured in the other system since the last syncronisation with MakePlans. New unprocessed bookings must be processed often (every 1-5 minutes) to ensure confirmations are sent out quickly to the end-user after requesting a new reservation.
NEVER delete any data in MakePlans to make it easier to adapt to the other system. MakePlans is a customer facing booking application. End-users (stored as people) can change and cancel bookings, thus any modifications or destruction of core data should not occur. Bookings are stored with a history (log) and there is a link between a person and bookings. MakePlans make use of this data and all this data must be kept to ensure the booking process in MakePlans works as expected for the end-user.
Expect all booking and person data to be changed at any time. All changes for an object will result in a updated attribute updated_at
.
We recommened storing a timestamp for when the syncronisation was last performed. When the syncronisation is performed again this timestamp can be used to fetch any changes on the updated_at
attribute for the object you want to retrieve (e.g. the parameter since
for bookings).
MakePlans does not officially support client libraries but they might be useful for you. Please note that these projects are not made by MakePlans but made publically available by other developers who have used the MakePlans API. Any questions should be made directly to the responsible developers. If you find any errors or areas of improvement please make a pull request to improve the project.
- NodeJS: https://github.com/mableteam/makeplans
- CakePHP: https://github.com/Pollenizer/CakePHP-MakePlans-Plugin
- Go: https://github.com/drewwells/makeplans
Not yet implemented
A webhook is simply a user-defined callback in the form of an HTTP POST which is invoked when something happens. So whenever a new booking is created in MakePlans we can send a POST request to the URL you specify. The response will include data about the modified object.
Slots are not physical objects in MakePlans. It is a virtual representation of available times based on attributes from resources and services. So if a resource is open 8am to 16pm and selected service has interval of 60 minutes, slots will return an array of all time intervals (8am-9am, 9am-10am etc.) and indicate which recoures are available.
Slots are meant for listing available times on the MakePlans booking page. You can however make bookings at any time and with any length - as long as the resource is available off course.
Name | Type | Description |
---|---|---|
timestamp | DateTime | Start |
timestamp_end | DateTime | End |
formatted_timestamp | String | Localised human readable format |
formattet_timestamp_end | String | Localised human readable format |
free | Integer | Free capacity |
open_resources | Array | Ids of open resources |
available_resources | Array | Ids of resources with availability |
GET /services/{service_id}/slots
will return slots for specified service.
Response
[
{
"slot": {
"timestamp": "2013-03-08T10:00:00+00:00",
"timestamp_end": "2013-03-08T10:15:00+00:00",
"formatted_timestamp": "Friday, March 8, 2013, 10:00 AM",
"formatted_timestamp_end": "Friday, March 8, 2013, 10:15 AM",
"free": 1,
"open_resources": [
1
],
"available_resources": [
1,2
]
}
}
]
Name | Type | Description |
---|---|---|
from | Date | Default: today |
to | Date | Default: today |
selected_resources | Array | Default: all active providers. |
GET /services/{service_id}/next_available_date
will return the next available date within 30 days with a free slot.
Response
[
{
"available_date": "2016-02-20"
}
]
Name | Type | Description |
---|---|---|
from | Date | Default: today. |
selected_resources | Array | Default: all active providers. |
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_by | DateTime | Automatically set |
updated_by | DateTime | Automatically set |
service_id | Integer | Not required |
event_id | Integer | Not required |
resource_id | Integer | Required |
person_id | Integer | Not required |
booked_from | Datetime | Required |
booked_to | Datetime | Required |
expires_at | Datetime | Not required |
notes | Text | Not required |
reminder_at | DateTime | Not required |
reminded_at | DateTime | Not required |
paid_at | DateTime | Not required |
external_id | String | Not required |
google_order_number | String | Not required |
custom_data | Array | Not required. |
state | String | Automatically set |
active | Boolean | Automatically set |
person_attributes | Object | See person |
count | Integer | Default: 1 |
collection_id | UUID | Automatically set for recurring bookings. |
- awaiting_verification
- verification_expired
- awaiting_payment
- awaiting_confirmation
- confirmed
- declined
- cancelled
- deleted
The normal booking flow when a customer initiates a new booking starts with awaiting_verification
. If verification is required MakePlans sends out email or SMS for the customer to verify. When successfully verified the state is updated to confirmed
or awaiting_confirmation
if reservations requires confirmation by administrator. For confirmation it is then updated to confirmed
as normally if confirmed, and to declined
if it is not confirmed.
Bookings that have been confirmed and then cancelled, either by customer or administrator, are set to cancelled
.
Bookings that are deleted are set to deleted
.
Bookings with states awaiting_verification
, awaiting_confirmation
or confirmed
are considered to be active. Bookings with state awaiting_verification
will be updated with state verification_expired
after the current time passes expires_at
. However updating states rely on automatic tasks so you must use the active
attribute to check whether a booking is active or not. Only active bookings will be returned unless you specify: a booking by id, a specific state such as bookings that are awaiting confirmation, to return all bookings for a resource or dates, or for a person.
GET /bookings
will return all active bookings. See query parameters for options.
GET /bookings/recent
will return all active bookings updated today.
GET /bookings/upcoming
will return all active bookings from and including {date}
.
GET /bookings/agenda
will return all active bookings within {date}
.
GET /bookings/unconfirmed
will return all unconfirmed bookings.
GET /bookings/all
will return all bookings of all states (including declined
, cancelled
, expired
and deleted
).
Response
[
{
"booking": {
"booked_from": "2012-09-29T07:00:00+02:00",
"booked_to": "2012-09-29T08:00:00+02:00",
"created_at": "2012-09-20T15:34:16+02:00",
"custom_data": {},
"count": 1,
"expires_at": null,
"external_id": null,
"id": 1,
"notes": "Very handsome client",
"person_id": 1,
"resource_id": 1,
"service_id": 1,
"state": "confirmed",
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
Name | Type | Description |
---|---|---|
service_id | Integer | |
event_id | Integer | |
resource_id | Integer | |
person_id | Integer | |
external_id | String | |
start | DateTime | booked_from after param |
end | DateTime | booked_to before param |
since | DateTime | updated_at after param |
collection_id | UUID |
POST /bookings
will create a new booking.
These parameters are part of booking eq.: booking[public_booking]
.
Name | Type | Description |
---|---|---|
public_booking | Boolean | Restrict to normal public booking rules such as within opening hours, not able to book in the past or past specified allowed date in the future. Recommended for all customer facing booking applications (e.g. integration on website). Not recommended when syncronising with other calendar programs. Default: false. |
These parameters are part not of booking[]
eq.: confirm
.
Outgoing messages requires person_id and service_id.
Default action for outgoing messages is according to the settings for booking verification. If email verification is enabled then all *_email
messages will be triggered by default to the customer. To override please see parameters for each action below. For admin notification messages the default is based on the client settings. SMS reminders is based on client settings and uses a default value for the time unless specified.
Name | Type | Description |
---|---|---|
confirm | Boolean | If set to false then the 'initiate verification' event is executed. If verification is required the state will be set to `awaiting_verification`. If no verification is required then the state will be set to `awaiting_confirmation` or `confirmed`. |
ignore_capacity | Boolean | Will force save the booking even though other bookings exists within the same time on the specified resource_id (double booking). Not applicable when `public_booking` is set to false (no double bookings allowed). Default: false. |
add_reminder_sms | Boolean | Automatically adds `reminder_at` based on setting from client atribute `sms_reminder_time`. Default: at 12PM the day before the appointment. |
verification_send_email | Boolean | Send out verification email. Only applicable when `confirm` is set to false. |
verification_send_sms | Boolean | Send out verification SMS. Only applicable when `confirm` is set to false. |
confirmation_send_email | Boolean | Send out confirmation email. |
confirmation_send_sms | Boolean | Send out confirmation SMS. |
notification_send_email | Boolean | Send out notification email to admin. |
notification_send_sms | Boolean | Send out notification SMS to admin. |
To add a new person along with a booking you must populate person_attributes
with person attributes. Values will be matched to an existing person based on email or phone number (in that order).
POST /bookings/recurring
will create a multiple bookings.
The recurrence format follows the iCalendar specification. The attributes for reccurence are: RRULE
, RDATE
, EXDATE
. For an introduction and examples of these parameters see http://www.kanzaki.com/docs/ical/rrule.html.
In the iCalendar specification the recurrence is based on values in DTSTART
and DTEND
. This is set by booked_from
and booked_to
from booking
.
All recurring bookings will except for booked_from
and booked_to
have the same attributes based on the specified parameters in booking
.
All bookings created by the recurring pattern gets the same UUID in collection_id
. As the collection name implies, and as is possible with the iCalendar specification, this is not necessarirly only for recurrence (i.e. 9am-10am each Friday until December 1st) but also for multiple specific times (as can be specified with RDATE
).
Only the collection_id
is returned. No bookings are created at the time of request as they will be processed by the server in the background due to the volume of bookings that it is possible to create at one time. A succesful response with a collection_id
does in no way indicate that any bookings will be created. The first booking as defined in booking
is however validated. If it is not valid errors details are returned in the same way as creating a single booking. In such a case recurring rules are not applied and you must adjust the request until validation is succesful.
The parameters for reccurence are not set in booking
but in recurrence
.
Name | Type | Description |
---|---|---|
rrule | String | Repeating pattern. Example: `FREQ=DAILY;UNTIL=19971224T000000Z`. |
rdate | String | List of recurring dates. Example: `VALUE=DATE:19970101,19970120,19970217,19970421`. |
exdate | String | List of dates that should be excluded from the recurring rule. Example: `VALUE=DATE:19970102`. |
You should always specify COUNT or UNTIL with RRULE. The max number of occurrences is 366, regardless if a limit is set or not.
GET /bookings/recurring/{collection_id}
will return all occurrences for a collection.
PUT /bookings/{booking_id}/verify
will verify a booking.
See information about additional parameters.
Name | Type | Description |
---|---|---|
confirmation_send_email | Boolean | Send out confirmation email. |
confirmation_send_sms | Boolean | Send out confirmation SMS. |
notification_send_email | Boolean | Send out notification email to admin. Default: based on client setting. |
notification_send_sms | Boolean | Send out notification SMS to admin. |
PUT /bookings/{booking_id}/confirm
will confirm a booking.
See information about additional parameters.
Name | Type | Description |
---|---|---|
confirmation_send_email | Boolean | Send out confirmation email. |
confirmation_send_sms | Boolean | Send out confirmation SMS. |
notification_send_email | Boolean | Send out notification email to admin. |
notification_send_sms | Boolean | Send out notification SMS to admin. |
PUT /bookings/{booking_id}/decline
will decline a booking.
See information about additional parameters.
Name | Type | Description |
---|---|---|
decline_send_email | Boolean | Send out decline email. |
decline_send_sms | Boolean | Send out decline SMS. |
PUT /bookings/{booking_id}/cancel
will cancel a booking.
See information about additional parameters.
Name | Type | Description |
---|---|---|
cancellation_send_email | Boolean | Send out cancellation email. |
cancellation_send_sms | Boolean | Send out cancellation SMS.. |
PUT /bookings/{booking_id}
will update a booking.
See information about additional parameters.
Name | Type | Description |
---|---|---|
ignore_capacity | Boolean | Set to true to allow a double booking. |
add_reminder_sms | Boolean | Automatically adds `reminder_at`. |
modification_send_email | Boolean | Send out modification email. |
modification_send_sms | Boolean | Send out modification SMS. |
DELETE /bookings/{booking_id}
will delete existing booking with id {booking_id}
.
Deleting a booking will set it to state=deleted and active=false. It will not be visible in listing, only when requesting GET /bookings/all
or by requesting the booking directly GET /bookings/{booking_id}
.
Do not use this method if the booking is rescheduled or cancelled.
See information about additional parameters.
Name | Type | Description |
---|---|---|
cancellation_send_email | Boolean | Send out cancellation email. |
cancellation_send_sms | Boolean | Send out cancellation SMS. |
The primary key for a person is id
. However the following fields are unique: email
, phonenumber
, national_id_no
and provider
+uid
. There are no specific requirements for input but a person needs to have either name, email, national id number or phone number.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
name | String | Not required. |
String | Not required. | |
phone_number | String | Not required. Phone number as stored. Also available as phonenumber (deprecated). |
phone_number_formatted | String | Only returnable. E.164 formatted phone number with plus sign, international code, and no spaces or parentheses. |
external_id | String | Not required |
custom_data | Array | Not required. Key/value. Stored as strings. |
date_of_birth | Date | Not required |
national_id_no | String | Not required. |
street | String | Not required. |
city | String | Not required. |
postal_code | String | Not required. |
state | String | Not required. |
country_code | String | Not required. ISO 3166-1 alpha-2. |
notes | Text | Not required. |
Searching unique fields (email
, phonenumber
, external_id
, uid
+provider
) will return only one result if found.
Response
[
{
"person": {
"created_at": "2012-09-20T15:34:16+02:00",
"custom_data": {},
"date_of_birth": null,
"email": "[email protected]",
"external_id": null,
"id": 1,
"name": "Espen Antonsen",
"national_id_no": null,
"notes": null,
"phonenumber": "",
"updated_at": "2012-09-20T15:34:16+02:00",
"phone_number_formatted": null
}
}
]
Name | Type | Description |
---|---|---|
String | ||
phonenumber | String | |
external_id | String | |
name | String | |
date_of_birth | Date | |
national_id_no | String |
POST /people
will create a new person.
PUT /people/{person_id}
will update existing person with id {person_id}
.
Not yet implemented
The purpose of this feature is to verify a new or existing person in MakePlans on your website such as "login to see your bookings". The verification can be done either using email or SMS. When successful you will have verified either an email or a phone number. Thus you can either create a new person or retrieve an existing person knowing that the person has been verified.
Please note that this token is perishable, meaning that it will be removed from and unavailable for verification after 10 minutes.
POST /people/perishable_token/send
will send a SMS with a five digit code (the token) or an email with a link which includes the token in the URL. Specify either person[email]
or person[phone_number]
.
POST /people/perishable_token/verify
. This will return a person if authentication is successful. If the email or phone_number is already registered to a person then that person will be returned. If no person exists with the specified email/phone_number then a empty person object will be returned. You then have to make another call to create the person. If the token and the identifier do not match an error is returned.
Specify the token as perishable_token
and the identifier in person[email]
or person[phone_number]
.
Authentication of person is done using a unique field: {email}
or {phone_number}
and {password}
.
POST /people/authenticate
. This will return a person if authentication is successful. You are still using your API-key so while the method is called authenticate
it is just a way to verify the credentials of a person.
GET /people/{person_id}/bookings
will retrieve all bookings for person with id {person_id}
.
There are two types of services:
- Appointment
- Attendance
Appointments can be booked within fixed opening hours as specified on the Resource and with exceptions specified in ResourceExceptionDate.
Attendance at an event is also a booking but the individual booking datetime or resource cannot be modified. Attendance is linked to an event which occurs at a specific time. One service can be linked to one or multiple events.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
title | String | Required |
active | Boolean | Automatically set |
booking_capacity | Integer | Not required |
day_booking_specify_time | Boolean | Not Required (default false) |
has_day_booking | Boolean | Not required (default false) |
interval | Integer | Not required (default 60) |
max_slots | Integer | Not required (default 1) |
price | Decimal | Not required. Uses currency on client. |
same_day | Boolean | Not required (default false) |
template | String | Component template (calendar view) |
interval_rounding | Integer | Overrides client default (see info on client object) |
booking_type_id | Integer | 1: appointment. 2: attendance. |
custom_data | Array | Not required. |
Response
[
{
"service": {
"active": true,
"booking_capacity": 1,
"created_at": "2012-09-20T15:34:16+02:00",
"custom_data": {},
"day_booking_specify_time": false,
"has_day_booking": false,
"id": 1,
"interval": 20,
"max_slots": null,
"price": "115.0",
"same_day": false,
"template": null,
"title": "Chiropractor",
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
POST /services
will create a new service.
PUT /services/{service_id}
will update existing service with id {service_id}
.
DELETE /services/{service_id}
will delete existing service with id {service_id}
. Deleting a service will set it to active=false and will not be returned in any listings.
Unlike appointments made through a normal service events starts and ends at a specific time. An event is connected to a resource and a service. It could be either a one-off event (e.q. a concert) or something that occurs multiple times (e.q. spinning class). Event bookings have a strong relation to the event. That means that it is not possible to modify details such as {booked_from}
, {booked_to}
, {resource_id}
and {service_id}
for the {booking}
. To make such changes it must be done to the event. All bookings connected to the event will then automatically me modified.
While events are connected to a resource bookings or capacity of an event are not restricted by the opening hours or availability of a resource.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
resource_id | Integer | Required |
service_id | Integer | Required |
published | Boolean | Default: true |
capacity | Integer | Required |
starts_at | Datetime | Required |
ends_at | Datetime | Required |
custom_data | Array | Not required |
description | Text |
Response
[
{
"event": {
"capacity": 10,
"created_at": "2012-09-20T15:34:16+02:00",
"custom_data": {},
"description": null,
"ends_at": "2015-08-10T11:30:00+02:00",
"id": 1,
"resource_id": 1,
"published": true,
"starts_at": "2015-08-10T10:00:00+02:00",
"service_id": 1,
"title": "Super fun event",
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
Name | Type | Description |
---|---|---|
service_id | Integer | |
resource_id | Integer | |
start | DateTime | starts_at after param |
end | DateTime | ends_at before param |
since | DateTime | updated_at after param |
POST /events
will create a new event.
PUT /events/{event_id}
will update existing service with id {event_id}
.
DELETE /events/{event_id}
will delete existing event with id {event_id}
. Deleting a event will set it to active=false and will not be returned in any listings.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
title | String | Required |
active | Boolean | Automatically set |
opening_hours_mon | Array | Default opening hours for Monday. |
opening_hours_tue | Array | Default opening hours for Tuesday. |
opening_hours_wed | Array | Default opening hours for Wednesday. |
opening_hours_thu | Array | Default opening hours for Thursday. |
opening_hours_fri | Array | Default opening hours for Friday. |
opening_hours_sat | Array | Default opening hours for Saturday. |
opening_hours_sun | Array | Default opening hours for Sunday. |
Values for the opening hours attributes is of type time in the array. Values are in the form of two's. This results in adding breaks within a day. To define opening hours from 8AM to 4PM with lunch at 12PM to 12.30PM the following array will be the result: ['08:00', '12:00', '12:30', '16:00']
. Having opening hours without a lunch break will yield this result: ['08:00', '16:00']
. To define a weekday as closed the value should be NULL
.
Name | Type | Description |
---|---|---|
open_0 | Time | Opening time for Monday |
open_1 | Time | Opening time for Tuesday |
open_2 | Time | Opening time for Wednesday |
open_3 | Time | Opening time for Thursday |
open_4 | Time | Opening time for Friday |
open_5 | Time | Opening time for Saturday |
open_6 | Time | Opening time for Sunday |
close_0 | Time | Closing time for Monday |
close_1 | Time | Closing time for Tuesday |
close_2 | Time | Closing time for Wednesday |
close_3 | Time | Closing time for Thursday |
close_4 | Time | Closing time for Friday |
close_5 | Time | Closing time for Saturday |
close_6 | Time | Closing time for Sunday |
These deprecated attributes define opening hours without breaks. Given opening_hours_tue
with a break defined as this: ['08:00', '12:00', '12:30', '16:00']
it would yield open_1
to be 08:00
and close_1'
to be 16:00
. These attributes are deprecated and will be removed in a future API version.
Response
[
{
"resource": {
"capacity": 1,
"created_at": "2012-09-20T15:34:16+02:00",
"id": 1,
"opening_hours_mon": ["08:00", "16:00"],
"opening_hours_tue": ["08:00", "11:00", "13:00", "17:30"],
"opening_hours_wed": ["08:00", "16:00"],
"opening_hours_thu": ["08:00", "12:00", "14:00", "20:00"],
"opening_hours_fri": ["08:00", "12:00", "12:30", "17:30"],
"opening_hours_sat": null,
"opening_hours_sun": null,
"title": "Mr. Spine Twister",
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
GET /resources/{resource_id}
will get a resource with id {resource_id}
.
Opening hours for specific dates is based on the standard opening hours that are specified on the resource but can be overridden with entries in resource exception dates.
Response
[
{
"resource_opening_hours": {
"date": "2015-12-03",
"opening_hours": ["10:00", "12:00"]
}
},
{
"resource_opening_hours": {
"date": "2015-12-04",
"opening_hours": null
}
}
]
Name | Type | Description |
---|---|---|
from | Date | |
to | Date |
GET /resources/{resource_id}/opening_hours
will get opening hours on specific dates for resource with id {resource_id}
.
POST /resources
will create a new resource.
PUT /resources/{resource_id}
will update existing resource with id {resource_id}
.
DELETE /resources/{resource_id}
will delete existing resource with id {resource_id}
. Deleting a resource will set it to active=false and will not returned in any listings.
Opening hours for a resource is what is used to generate available slots for a service. It is based on the default opening hours on the resource unless anything else is specified by a resource exception date. So ignore the poorly naming of the feature and treat it as opening hours on dates. If a resource should be closed for a week then you would add resource exception dates. If a resource should have opening hours 08:00 to 14:00 on January 5th 2016 instead of the default opening hours for that weekday which could be 09:00 to 15:00, then add it as a resource exception date. See resource opening hours for how to specify.
Exception dates are related to a resource: GET /resources/{resource_id}/exception_dates
.
Name | Type | Description |
---|---|---|
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
resource_id | Integer | Required (specified in URL) |
exception_date | Date | Required (specified in URL) |
opening_hours | Array | Same format as resource opening hours |
Response
[
{
"resource_exception_date": {
"created_at": "2012-09-20T15:34:16+02:00",
"resource_id": 1,
"exception_date": "2014-01-08",
"opening_hours": ["08:00", "12:00", "12:30", "17:30"],
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
Name | Type | Description |
---|---|---|
from | Date | |
to | Date |
GET /resources/{resource_id}/exception_dates/{exception_date}
will get the exception date {exception_date}
for resource {resource_id}
. If no existing entry is found a 404 HTTP status code is returned. In that case standard opening hours apply.
POST /resources/{resource_id}/exception_dates/{exception_date}
will create a new or update an existing exception date {exception_date}
for resource {resource_id}
. You can also use PUT
, both methods works the same way regardless if it is a new entry or an update to an existing one.
POST /resources/{resource_id}/exception_dates/
will create new or update existing exception dates for resource {resource_id}
. You can also use PUT
, both methods works the same way regardless if it is a new entry or an update to an existing one.
To delete an existing exception date set {_destroy}
to be true.
{
"resource_exception_dates": [
{
"exception_date": "2015-10-22",
"opening_hours": [
"12:00",
"14:30"
]
},
{
"exception_date": "2015-10-25",
"opening_hours": [
"08:30",
"12:30",
"15:00",
"18:30"
]
},
{
"exception_date": "2015-10-26",
"opening_hours": [
"10:30",
"15:00"
]
},
{
"exception_date": "2015-10-27",
"opening_hours": null
},
{
"exception_date": "2015-10-28",
"_destroy": true
}
]
}
DELETE /resources/{resource_id}/exception_dates/{exception_date}
will delete existing exception date {exception_date}
for resource {resource_id}
.
Resources provides services. This link is called a provider.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
active | Boolean | Automatically set |
resource_id | Integer | Required |
service_id | Integer | Required |
Response
[
{
"provider": {
"created_at": "2012-09-20T15:34:16+02:00",
"id": 1,
"resource_id": 1,
"service_id": 1,
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
POST /providers
will create a new provider.
DELETE /providers/{provider_id}
will delete existing provider with id {provider_id}
.
Services can be listed in a category. Categories can be presented like a tree. Root categories are defined with empty {parent_id}
.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
title | String | Required |
parent_id | Integer | |
custom_data | Array | Not required. |
Response
[
{
"category": {
"created_at": "2012-09-20T15:34:16+02:00",
"custom_data": {},
"id": 1,
"parent_id": null,
"title": "My first little category",
"updated_at": "2012-09-20T15:34:16+02:00"
}
}
]
POST /categories
will create a new category. To add connected services specify array of {service_id}
in parameter {service_id_list}
.
PUT /categories/{category_id}
will update existing category with id {category_id}
. To add connected services specify array of {service_id}
in parameter {service_id_list}
.
DELETE /categories/{category_id}
will delete existing category with id {category_id}
.
Users who can login into the account.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
name | String | Required |
String | Required | |
phonenumber | String |
Information and settings for your account.
Name | Type | Description |
---|---|---|
id | Integer | Automatically set |
created_at | Datetime | Automatically set |
updated_at | Datetime | Automatically set |
subdomain | String | Required |
String | Required | |
name | String | Required |
mail_verification | Text | |
mail_confirmation | Text | |
google_analytics | String | |
css_url | String | |
time_zone | String | Required |
verification_method | Integer | |
new_user_text | Text | |
address | String | |
country_code | String | Required. ISO 3166-1 alpha-2. |
google_merchant_id | String | |
google_merchant_key | String | |
logo | File | |
template | Integer | Required |
service_template | String | |
locale | String | Required. Supported locales: 'en' and 'no-NB'. Default 'en'. |
currency | ISO4217 currency code | |
email_notification | Boolean | |
mail_notification_recipient | ||
sms_notification | Boolean | |
phone_number | String | |
confirm_manually | Boolean | |
settings | Array | |
interval_rounding | Integer | Default setting for all services for rounding to next available time. '15' will round 10:07 to become 10:15 as next available slot time. |
slot_generation_type | Integer | Default: 2. 1=fixed. 2=next available. |
future_bookable_period | String | |
public_access | Boolean | |
first_bookable_period | String | |
payment_provider | String | |
footer | Text | |
verification_methods | String | |
reminder_sms | Boolean | |
closed_for_holidays | Boolean | |
new_user_text | Text (Supports Liquid) | |
new_booking_text | Text (Supports Liquid) | |
booking_form | Text | |
person_form | Text (Supports Liquid) | |
resource_form | Text (Supports Liquid) | |
service_form | Text (Supports Liquid) | |
event_form | Text (Supports Liquid) | |
appointment_form | Text (Supports Liquid) | |
category_form | Text (Supports Liquid) | |
sms_confirmation | Text (Supports Liquid) | |
sms_verification | Text (Supports Liquid) | |
sms_reminder | Text (Supports Liquid) | |
sms_modification | Text (Supports Liquid) | |
sms_cancellation | Text (Supports Liquid) | |
mail_verification | Text (Supports Liquid) | |
mail_confirmation | Text (Supports Liquid) | |
mail_modification | Text (Supports Liquid) | |
mail_cancellation | Text (Supports Liquid) | |
mail_verification_subject | String | |
mail_confirmation_subject | String | |
mail_modification_subject | String | |
mail_cancellation_subject | String |
Name | Type | Description |
---|---|---|
remove_logo | Boolean |
PUT /client
will update the account.
Who doesn't like a holiday?
Response
[
{
"holiday": {
"date": "2016-01-01",
"name": "New Year's Day"
}
},
{
"holiday": {
"date": "2016-05-01",
"name": "International Workers' Day"
}
}
]
Name | Type | Description |
---|---|---|
from | Date | |
to | Date |
GET /client/holidays
will get holidays for client country.