In this article, we will explain how to create a new reservation for the Charleston Hotel by using Postman or the command line.
Creating a booking with Postman
- To create a booking in Postman, (if you haven't already) you will need to follow the instructions in our How to configure Postman guide.
- Go to the Impala API collection and Create Booking.
- If you haven't created a Postman environment you will need to add the below (instructions on how to do this are provided in our Postman guide).
- hotelId:
this is your hotel ID
- apiKey:
this is the API key
- hotelId:
- Once you have configured the query, click on SEND.
- You can then view the booking in the Response window.
Creating a booking from the command line
- Here is the basic API call that we will be using:
-
curl --location --request POST 'https://api.getimpala.com/v2/hotel/{{hotelid}}/booking' --header 'Content-Type: application/json' --header 'Authorization: Bearer {{bearer token}}' --data-raw '{"start": {{start date}}, "end": {{end date}}, "ratePlanId": "5d72544d1d423272b91e2f40","guests": [ "5d72544d73ebbc9d33128f71"],"contact": {"id": "5d72544d73ebbc9d33128f71","type": "guest"}}'
-
- Before you can use the above you will need to make a few changes to the API call, here is the date that you will need to provide.
- Copy and paste the API call in a word processor.
- Replace {{hotelid}} with your hotel ID.
- Replace {{bearer token}} with your API key.
- Finally replace {{start date}} and {{end date}} with an epoch timestamp, you can use https://www.epochconverter.com/ to easily convert a timestamp.
- Open the Terminal application.
- Copy and paste the modified API call in your terminal window.
- You should then receive the API response containing your new booking.
If you want to make additional changes to the API call please check out our API documentation: https://docs.getimpala.com/#create-booking where we have provided a list of fields that you can modify.