Open-api’s documentation
Current version
The API is versioned using a version suffix in the URLs, the current version is the version 1 and is expressed by using a v1 prefix URL fragment.
Schemas
All API access is over HTTPS, and accessed from https://demo-openapi.addk.fr . All data is sent and received as JSON. The Addock API uses several data types, some of those types are expressed as standardized strings. The API is designed to use standards as much as possible because it facilitates integrations with other systems and migrations. The standards we currently use are the followings:
Country codes and territories : ISO 3166
Currencies : ISO 4217
Dates and times : RFC 3339
Languages : BCP 47 and / or ISO 639.
Time Zones : Taken from the IANA Time Zone Database.
Authorization
By default all API endpoints are protected and will return the following error.
The endpoints are protected using the OAuth 2.0 protocol. So, authorizations are granted when a specific OAuth 2.0 Access Token is provided. An OAuth 2.0 Access Token can be obtained using key / value credentials which should have been provided to you by Addock (if you do not have credentials please contact us at contact@addock.co). Here is a sample which shows how to retrieve an OAuth 2.0 access_token.
In this sample the OAuth 2.0 Access Token retrieved is acefad39-3afc-4e46-a6ea-9531a90804e8, you can then provide this value with the access_token URL parameter to authorize your requests.
Supported grant types WARNING currently the Addock API only supports the client_credentials grant type. To prevent security problems this grant type should only be used for server to server communications. So you should not use the client_credentials grant type to request the APIs from a browser for example. This is very important because Addock uses access tokens which have a farther expiration date with client_credentials. Because browsers could cache and expose the access tokens it is not advised to use a token which is valid during a long time in this case.
Token validity duration
To increase security the OAuth 2.0 Access Token provided by our servers are valid during 24 hours. It means that your source code should automatically refresh your access token before the 24 hours are elaspsed. Refreshing the access token is very simple and just requires a new request on the token endpoint the same way you did it to retrieve your first access token.
Rate Limiting
To prevent abuses the Addock API is rate limited. The first time you use the API your account is generally configured with default rate limits. The default rate limits allows 100 API calls during the last 10 minutes, if this limit is exceeded a 429 HTTP error like this one will be returned.
This error indicates that too many requests were executed, the metadata gives detailed about the rate limit rules which are configured on your account. For example the previous payload indicates that the account is configured with one rate limit rule allowing 100 calls during a sliding time window of 600 seconds (or 10 minutes). The rate limit configuration is generally configured in relation with the contract settled between Addock and your company. If you need a custom rate limit configuration please contact us at contact@addock.co).
Errors
The errors returned by the API use the API Problem standard, so all errors have the same structure, for example.
Embeddedd resources
When you send a GET request, you can ask to API to add specifics informations. Availables informations are specified for each Object.
For that, you need to add &embed=<resource1>,<resource2> at the end of your request.
This section lists requests about addresses
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about bookings
Embedded resources :
associated_bookings |
booking_linked |
beneficiary |
commissions |
order |
merchant |
product |
promo_code_generated |
promo_codes |
term_cancel |
time_ranges |
Request to get all bookings of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get a particular booking of company connected
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get booking’s participant clients data
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get booking’s participant client form
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get booking’s participant client data
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about companies
Embedded resources :
activities |
address |
country |
default_currency |
default_language |
languages |
legal_form |
reseller_type |
tax |
translations |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
You get informations about the company connected with the token.
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about languages
List all languages availables for the connected company
Key | Value | Description |
---|---|---|
access_token | e89abf88-4428-4087-bb68-228bcc9cdb21 |
Get a particular language
Key | Value | Description |
---|---|---|
access_token | e89abf88-4428-4087-bb68-228bcc9cdb21 |
This section lists requests about orders
Embedded resources :
company |
user |
bookings |
bookings_product |
bookings_product_images |
bookings_time_ranges |
promo_codes |
Request to get all orders of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get a particular order of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get all booking’s payment methods
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get all booking’s promo codes
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about payment methods
Request to get all payment methods of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get a payment method of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about products
PricingType : 0 => Classic ; 1 => FORFAIT ; 2 => SESSION
For Session, the form asking for unit will be show after the date selection.
ScheduleType : OPEN_BILLET -> date
OPEN_BILLET_WITHOUT_DATE -> no date
EXACT_DATES_AND_TIMES -> date and hours
SHOP_HOURS -> date and hours
Embedded resources :
address |
category |
external_platform |
extra_products |
gift_products |
merchant |
images |
prices |
product_unit_resources |
sub_category |
tags |
tax |
unit |
Request to get all products of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
latitude (optional, longitude must be filled in if used) | ex:46.647568100000 | latitude to filter products |
longitude (optional, latitude must be filled in if used) | ex:-1.830143100000 | longitude to filter products |
radius (optional, longitude and latitude must be filled in if used) | ex:7.8 | radius to filter products (in km) |
Request to get a particular product of connected company
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Request to get order’s day availabilities
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
from_date | ex= 2019-01-17T01:00:00.000Z | The research begin at 'from_date' |
unit_quantities (optional) | {unitID}:{quantities}; ex= unit_quantities=7664:4 | unit linked with product |
next_available_date (optional) | True or False | Continue to search after date given by from_date |
Request to get order’s time slot availabilities
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
on_date | Date in ISO format, ex= 2019-01-21T01:00:00.000Z | |
unit_quantities (optional) | {unitID}:{quantities}; ex= unit_quantities=7664:4 | unit linked with product |
This section lists requests about product categories
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about taxes
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about product sub categories
Embedded resources :
category |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about terms sale
List all terms sale availables for the connected company ( terms sale of connected company and terms sale of company’s partners )
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Get a particular term sale
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
This section lists requests about units
Embedded resources :
translations |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |
Requests about user client data
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Key | Value | Description |
---|---|---|
access_token | {token} | company's token |