Chatdesk API

Getting started

Chatdesk is easy to integrate into your existing PMS that you might be using. With the Chatdesk API, you can-

  • create a reservation: Once you create a reservation, your guests can start chatting with the hotel using Chatdesk.
  • mark a reservation as complete: After reservation is marked as complete, the guest receives a feedback request and his chat with hotel is disabled.

Before using APIs

You would need to take the note of following before you can start using the APIs-

  • Access token: Access token is used to partly authenticate your API calls. You can see the access token on your profile page.
  • Account email: You need to pass on the account email, this also can be seen on your profile page
  • Hotel Id: Any calls to create a reservation or to mark it as complete has to provide the Id of the hotel and this can be seen on the hotel details page.

    • Create A Reservation

  • API endpoint: https://www.chatdesk.co/api/v1/create_reservation.json
    API Headers: Please pass on the following params in your header-

    • token(required) This is your access token.
    • email(email) Email for your account
    API Parameters:
    • hotel_id (required) Id of the hotel to which reservation is to be created
    • reservation[external_id] If you have an external reservation system which generates unique ID, you can pass on that unique ID here. At the end of stay, the same unique ID can be used to mark the reservation as complete.
    • reservation[guest_name] (required) The name of the guest staying
    • reservation[guest_phone_number](suggested) Phone number of the guest.
    • reservation[email](suggested) Email of the guest
    • reservation[room_details](required) The room in which the guest is staying
    Please note that either phone number or the email of the guest should be passed on, else there is no way to communicate with the guest.
    Once you create the reservation, you get a JSON response containing the details of the reservation created on Chatdesk.

    Example curl request to create a reservation


    curl -d “hotel_id=1&api_version=1&reservation[external_id]=RASHTRA&reservation[guest_name]=Neeraj&reservation[guest_phone_number]=+919704199305&reservation[room_details]=Ghost” -H “token:Y0urAccessT0ken” -H “email:shklnrj@gmail.com” https://www.chatdesk.co/api/v1/create_reservation.json

    Example response

    {“id”:16,”hotel_id”:1,”user_id”:10,”is_active”:true,”reservation_token”:”vobxDE5MLAyn-3H9yVJs”,”created_at”:”2016-05-09T15:56:29.875Z”,”updated_at”:”2016-05-09T15:56:29.875Z”}


    • Mark a reservation as completed

  • API endpoint: https://www.chatdesk.co/api/v1/mark_reservation_as_over.json
    API Headers: Please pass on the following params in your header-

    • token(required) This is your access token.
    • email(email) Email for your account
    API Parameters:
    • hotel_id (required) Id of the hotel to which reservation is to be created
    • reservation[external_id] If you have an external reservation system which generates unique ID, you can pass on that unique ID here. At the end of stay, the same unique ID can be used to mark the reservation as complete.
    • reservation[id] If you don't have an exteral reservation system to generate unique id but are using the Chatdesk API, then you need to store the reservation ID returned by Chatdesk during the reservation creation process. That ID is to be used here.
    Please note that you need to provide either reservation[external_id] or reservation[id] to uniquely identify the reservation in question.
    Once you mark the reservation as over, you get a JSON response having current details of the reservation on Chatdesk.

    Example curl request to mark a reservation as over


    curl -d “hotel_id=1&api_version=1&reservation[external_id]=RASHTRA&reservation[guest_name]=Neeraj&reservation[guest_phone_number]=+919704199305&reservation[room_details]=Ghost” -H “token:Y0urAccessT0ken” -H “email:shklnrj@gmail.com” https://www.chatdesk.co/api/v1/mark_reservation_as_over.json

    Example response

    {“reservation”:{“is_active”:false,”id”:16,”room_details”:”Ghost”,”hotel_id”:1,”reservation_token”:”vobxDE5MLAyn-3H9yVJs”,”user_id”:10,”created_at”:”2016-05-09T15:56:29.875Z”,”updated_at”:”2016-05-09T15:59:33.030Z”,”customer_rating”:null,”feedback_comment”:null,”salutation_is_seen_by_guest”:false,”external_id”:”RASHTRA”,”confirmation_number”:null}}


    If you face any issues in using the Chatdesk API, please feel free to contact us.