# Using Postman collection

Learn how to use the Token-based authentication endpoint using a Postman collection to interact with Booking.com's API.

Postman is a popular API client that helps you test and interact with APIs. Booking.com provides a ready-to-use Postman collection that includes all supported actions for the Token-based authentication endpoint, making it easier to test API functionality with your test property.

If you already use Postman, you can  download the collection and try out the Token-based authentication endpoint.
If you are not familiar with Postman, [learn more](https://www.postman.com/) to see whether it might be useful for you.

## Getting started

Once you have downloaded and imported the collection in your Postman environment, you can set up the client ID and Client secret in the Collection's **Variables** tab.

### Prerequisites

- A Postman account and the Postman application installed
- Valid Booking.com API credentials (client ID and client secret)
- A test property ID


## Setup instructions

1. Download the Postman collection using the link above.
2. Import the collection into Postman:
  - Open Postman
  - Click **Import** in the top left corner
  - Select the downloaded JSON file
3. Configure your credentials in the Collection's **Variables** tab:
  - client_id: Your Booking.com API client ID
  - client_secret: Your Booking.com API client secret
  - property_ID: Your test property ID


## Postman collection structure

We have organised the postman collection into 5 logical steps to demonstrate a typical workflow:

- Step 1 - Get a fresh token: Authenticate and obtain an access token.
- Step 2 - Get room details: In this step you retrieve the room type ID of your test property.
- Step 3 - Get rate plan details: In this step you retrieve the rate plan ID of your test property.
- Step 4 - Get roomrates: In this step you can retrieve the room rate details of your test property.
- Step 5 - Create availability: In this step you set availability for your test property.


## Troubleshooting

If you get a `HTTP 401 Unauthorized` with the following response body, make sure to check whether the credentials you provided have access to the property specified in the `property_ID`:


```xml
<fault code="401">
        <string>Authorization Required</string>
</fault>
```