Retrieve authorisation tokens for Messaging API

Hold Notice

This product is currently on hold. Unfortunately, this means we will not provide support or certify any new providers until the hold is released.

You need authorisation tokens to use the Messaging API. Use /json/messaging-auth to retrieve these tokens. Each authorisation token is valid for 1 hour.

HTTP request

GET https://supply-xml.booking.com/hotels/json/messaging-auth?hotel_id=1234567

Parameters

Parameter Description Type Min/max Notes
hotel_id The Booking.com property ID. int 0..* Include this parameter more than once to specify multiple IDs. The API returns a token for each ID. If you don't specify any ID, you'll receive a single token that works for all your connected properties.

Request headers

Header Description Type Required Notes
Content-Type The format of the request body. string Required Should be application/json.
Authorization Machine account username and password string Required Example: Authorization: Basic {username:password}

Request body

This request has no body. All arguments are specified in the URL.

Response headers

Header Description Notes
X-RUID Unique ID of the response. -

Response body

Field Description Type Min/max Notes
result Wrapper for authorisation tokens. object 1..1 Contains one or more key/value pairs, with the formula hotel_id : token. If you didn’t specify hotel_id in the request, you'll get only the pair all : token.
warnings Warnings, if any. array of warning objects 0..1 -
errors Errors, if any. array of error objects 0..1 -

Sample response

Token for all properties:

{
  "result": {
    "all": "xxxx"
  }
}

Tokens for multiple properties (with warnings):

{
  "result": {
    "123": "xxxx",
    "456": "xxxx"
  },
  "warnings": [ {
    "hotel_id": "321",
    "message": "Permission denied while accessing hotel",
    "code": "ERR_UNAUTHORIZED"
    }]
  }

Status codes and errors

The API can return the following HTTP status codes.

Code Description Notes
200 OK The request was successful.
400 Bad Request There was something wrong with the request format and/or content.
403 Forbidden You don't have permission to access the specified properties. The request needs to be changed before retrying.
500 Internal Server Error Try again later.