Bookings

The booking API allow you to create new Bookings in the Roomonitor platform.

You have two options for booking:

These before methods requires an authenticated Auth Token and specify your apartments or rooms with the Roomonitor RoomId.

You would need to call to the Auth and getRooms API.

Booking API for Door opening control

This endpoint generates bookings for SmartLock door openings control.

The bookings imported with this method can be displayed and manage manually inside the booking section in Roomonitor backend web.

When you import import one booking the Roomonitor platform sends an email and SMS message to the main email account and phone number specified in the booking (the guest email and phone) with the instructions for load in the Guest Assistant Mobile Application, the booking and open keys for the doors associated to the reserved room.

API Server: https://bookings.roomonitor.com

Endpoint: /v1/import_bookings/{userId}

HTTP Method: POST

Authenticated: true

Parameters:

Auth headers:

  • X-User-Id:{userId} (required) The userId must be the same as the before userId parameter example X-User-Id: 9yOHMi8fDXsweQ21
  • X-Auth-Token:{authToken} (required) The authToken obtained with the Authentication Login API Call example X-Auth-Token: wiiz1oKVwxemzcHbXJEOxs4-gRp2jNPH6ifxXtAX_Zz

Body Payload:

Bookings JSON Array in the body payload

[
    {
        firstname:[string],
        lastname: [string],
        prefix: [string],
        telephone: [string],
        email: [string],
        room:[string],
        checkin: [string],
        checkout: [string],
        customerReference: [string]
    }
]

Note:

  • firstname and lastname is the main guest linked to the booking.
  • prefix is the phone number prefix specified like Country Phone Code.
  • room makes reference to your booking room id. You can access that info with Get Rooms API Call endpoint.
  • checkin and checkout codes the checkin and checkout booking dates specified like YYYY-MM-DD.
  • customerReference is your internal booking id in your platform.

Example:

[
    {
        "firstname":"Jose",
        "lastname": "Garcia González",
        "prefix": "34",
        "telephone": "666555444",
        "email": "[email protected]",
        "room": "gNY7H9ND3KMzbsFAQ",
        "checkin": "2018-02-10",
        "checkout": "2018-02-12",
        "customerReference": "666555444"
    },
    ...
]

Success Response

Code: 200 Content: > JavaScript array with importation result

Error Response

Code: 401 Response:

{ status: 401, message: 'Unauthorized' }

Code: 400 Response:

{ status: 400, message: "No customer found with given customer ID" }

Code: 400 Response:

{ status: 400, message: "No bookings to update: empty request body" }

Code: 400 Response:

{ status: 400, message: "No customer ID" }

Booking API for Noise Alerting

This endpoint imports the daily bookings of the associated rooms. This information is used for to generate alerting calls and SMS to the guests phone at first level, and to the NightAgent or configurated Room Alerting Phone Number at second level.

API Server: https://bookings.roomonitor.com

Endpoint: /v2/import_bookings/{userId}

HTTP Method: POST

Authenticated: true

Parameters:

Auth headers:

  • X-User-Id:{userId} (required) The userId must be the same as the before userId parameter example X-User-Id: 9yOHMi8fDXsweQ21
  • X-Auth-Token:{authToken} (required) The authToken obtained with the Authentication Login API Call example X-Auth-Token: wiiz1oKVwxemzcHbXJEOxs4-gRp2jNPH6ifxXtAX_Zz

Body Payload when using roomId:

Bookings JSON Array in the body payload

[
    {
        id: [string],
        roomId: [string],
        checkin: [timestamp],
        checkout: [timestamp],
        guestPhone: [string],
        guestName: [string],
        lang: [string]
    }
]

Body Payload when using customRoomId :

Bookings JSON Array in the body payload

[
    {
        customRoomId: [string],
        idBooking: [string],
        pm: [string],
        bookingType: [string],
        checkin: [timestamp],
        checkout: [timestamp],
        guestPhone: [string],
        guestName: [string],
        lang: [string]
        updatedBooking: [boolean]
    }
]

Note:

  • id is an optional field. You can provide your own internal booking id.
  • customRoomId or roomId is an required field. You need to provide one of the two.If you put customRoomId, you will be providing an external id, which will serve to identify a room of an integration outside of roomonitor. If you put roomId makes reference to your booking room id. You can access that info with Get Rooms API Call endpoint.
  • checkin / checkout must be in timestamp format with milliseconds. You can provide another format but parsing proccess could fail and store wrong dates.
  • guestPhone comma separated phone list, should have its phone zone number at the beginning specified like +<prefix><phone number>, and the phone number must be without spaces.
  • In the case of use customRoomId you can provide mandatory parameters, in case of insertion, or optional in case of update.
    1. idBooking is an required field. This ID refers to the ID of an external booking, used to update the booking.
    2. bookingType it is a required field in the insert, and optional in the update. This is the status of the reservation.
    3. pm is an required field. Refers to the type of external integration we are using, for example: zapier, avantio… It is used to identify in which integration of the room, you have to look for the customRoomId
    4. updatedBooking is an optional field, but if you want to update the booking, it must be set to true. This field is used to specify if you want to update or insert the booking, if true, it will be updated, all the fields being optional, except the customRoomId, idBooking and pm.
    5. guestPhone / guestName / lang / checkin / checkout it is a required field in the insert, and optional in the update.

Example with roomId:

[
  {
    "id": "15566",
    "roomId": "ejhWzDtHadR4MYLJ",
    "checkin": 1518865200000,
    "checkout": 1518865200000,
    "guestPhone": "+34666555666",
    "guestName": "LOUIS MCARTHUR",
    "lang": "EN"
  },
  {
    "id": "15567",
    "roomId": "f3akp9P8WZtyGKbdhj",
    "checkin": 1673446772000,
    "checkout": 1673792372000,
    "guestPhone": "+34666555666, +34656656656",
    "guestName": "JOHAN MCMANAMAN",
    "lang": "ES"
  }
]

Example with customRoomId, insert and update: Insert

[
  {
    "customRoomId": "15568",
    "idBooking": "344556621",
    "pm": "zapier",
    "bookingType": "Booked",
    "checkin": 1518865200000,
    "checkout": 1518865200000,
    "guestPhone": "+34666555666",
    "guestName": "LOUIS MCARTHUR",
    "lang": "EN",
    "updatedBooking": false, // you can skip it 
  }
]

Update

[
  {
    "customRoomId": "15568",
    "idBooking": "344556621",
    "pm": "zapier",
    "bookingType": "Cancel",
    "guestName": "PERLIERE PETILLOT",
    "lang": "EN",
    "updatedBooking": true,
  }
]

Success Response

Code: 200 Content:

[
    "[SUCCESS][Booking ID: 15566] Booking saved successfuly", 
    "[SUCCESS][Booking ID: 15567] Booking saved successfuly" 
]

If some of the bookings failed at insert you’ll be noticed in the response content with the success bookings.

Error Response

Code: 401 Response:

{ status: 401, message: 'Unauthorized' }

Code: 400 Response:

{ status: 400, message: "No customer found with given customer ID" }

Code: 400 Response:

{ status: 400, message: "No bookings to update: empty request body" }

Code: 400 Response:

{ status: 400, message: "No customer ID" }