How to use it?
HTTP Methods
The API is accessible only through the Https protocol and only accepts HTTP GET requests.
It's made to retrieve information only – and not to modify it in any way.
UAT base URL:
"https://rec-api.accor.com/referentials/"
PRO base URL:
"https://api.accor.com/referentials/"
All API calls start with this URL plus the path to the desired repository.
UAT Example: "https://rec-api.accor.com/referentials/v1.0/calendar"
HTTP Response codes
We use conventional HTTP response codes to indicate the success or failure of an API request.
- Codes in the 2xx range indicate success.
- Codes in the 4xx range indicate an error.
- Codes in the 5xx range indicate an server error.
Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported.
HTTP ACCEPT-LANGUAGE
Our API supports, with certain qualifications, the ability to specify languages as part of an HTTP request, using the ACCEPT-LANGUAGE HTTP header. The REFERENTIAL API honors this header where possible, selecting a language from the ACCEPT-LANGUAGE header and returning messages in that language.
When the ACCEPT-LANGUAGE header contains no language or a language that the API can't support, messages are returned in a default language, in this case it will be English.
Example
Using REFERENTIAL with CATALOG
When your are using the CATALOG API in the response there are various codes
{
"id": "0911",
"lodging": "HTL",
"brand": "NOV",
"scale": "FI",
"currencyCode": "EUR",
"spokenLanguages": [
"DE",
"EN",
"ES",
"FR"
],
REFERENTIAL API will provide the labels for thoses codes in unitary calls:
- "/referentials/v1.0/lodgings"
- "/referentials/v1.0/brands"
- "/referentials/v1.0/currencies"
- "/referentials/v1.0/languages"
{
"brands": [
{
"code": "GRE",
"value": "Greet"
},
{
"code": "NOV",
"value": "Novotel"
},
{
"code": "SOF",
"value": "Sofitel"
}
]
}
REFERENTIAL API will provide the list of available referential with the following call:
- "/referentials/v1"
[
{
"method": "GET",
"href": "https://rec3-secure.accorhotels.ws/web/referential/v1/referential?expand=all",
"rel": "all"
},
{
"method": "GET",
"href": "https://rec3-secure.accorhotels.ws/web/referential/v1/referential?expand=user-preferences",
"rel": "user-preferences"
},
{
"method": "GET",
"href": "https://rec3-secure.accorhotels.ws/web/referential/v1/referential?expand=brands",
"rel": "brands"
},
{
"method": "GET",
"href": "https://rec3-secure.accorhotels.ws/web/referential/v1/referential?expand=accommodation-types",
"rel": "accommodation-types"
},
{
"method": "GET",
"href": "https://rec3-secure.accorhotels.ws/web/referential/v1/referential?expand=accommodation-standards",
"rel": "accommodation-standards"
},
REFERENTIAL API will provide all the referential data il one single call:
- "/referentials/v1?expand=all"
{
"accommodation-beddings": [
{
"code": "QUEEN_SOFA_BED",
"value": "Queen size sofa beds"
},
{
"code": "DESK_BED",
"value": "Desk and bed sets"
}
],
"accommodation-standards": [
{
"code": "OPERA",
"value": "Opera"
},
{
"code": "XXL_MAMA_TWO_BEDROOM_TERRACE",
"value": "XXL Mama Two Bedroom Terrace"
}
],
"accommodation-types": [
{
"code": "TENT",
"value": "Tent"
},
{
"code": "SINGLE_BED",
"value": "Single Bed"
}
],
"accommodation-views": [
{
"code": "SEA_SIDE",
"value": "Sea side"
},
{
"code": "CITY_SIDE",
"value": "City View"
You can also select several referentials in one single call:
- "/referentials/v1.0?expand=amenities&expand=arrival-times&expand=brands"
{
"amenities": [
{
"code": "PARKING",
"label": "Car park",
"filterCategory": "access",
"topService": true,
"topOrder": 1,
"topCategory": "PARKING"
},
{
"code": "SHOPPING_MALL",
"label": "Shopping mall",
"filterCategory": "SHOPS",
"topService": false
}
],
"arrival-times": [
{
"code": "12:00",
"value": "Before noon",
"start": "04:01",
"end": "12:00"
},
{
"code": "23:59",
"value": "After 11 pm",
"start": "23:01",
"end": "04:00"
}
],
"brands": [
{
"code": "GRE",
"value": "Greet"
},
{
"code": "TST",
"value": "HOTEL DE TEST"
}
]
}