Getting started

example image

Before beginning work it is necessary that:

  • Your organization is registered and activated
  • You have participated in a kick­off meeting
  • The opening questionnaire has been filled out
  • You have your login and password. (Using it you get a unique session token that must be used in every request to API as param jwt)

Contact us to be registered and get your credentials.

All responses are returned as JSON.

This document covers all the API calls and other methods that can be used to complete Razor-Cloud integration. It is important to note that all parameters are case sensitive in this document and should be used as documented.

Responses: When a request is successful, a response body will typically be sent back in the form of a JSON object. An exception to this is when a DELETE request is processed, which will result in a successful 200 status and an empty response body.

How to Build

This client library is a Ruby gem which can be compiled and used in your Ruby and Ruby on Rails project. This library requires a few gems from the RubyGems repository.

  1. Open the command line interface or the terminal and navigate to the folder containing the source code.
  2. Run gem build asdawqw.gemspec to build the gem.
  3. Once built, the gem can be installed on the current work environment using gem install asdawqw-2.1.1.gem

Building Gem

How to Use

The following section explains how to use the Asdawqw Ruby Gem in a new Rails project using RubyMine™. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

1. Starting a new project

Close any existing projects in RubyMine™ by selecting File -> Close Project. Next, click on Create New Project to create a new project from scratch.

Create a new project in RubyMine

Next, provide TestApp as the project name, choose Rails Application as the project type, and click OK.

Create a new Rails Application in RubyMine - step 1

In the next dialog make sure that correct Ruby SDK is being used (minimum 2.0.0) and click OK.

Create a new Rails Application in RubyMine - step 2

This will create a new Rails Application project with an existing set of files and folder.

2. Add reference of the gem

In order to use the Asdawqw gem in the new project we must add a gem reference. Locate the Gemfile in the Project Explorer window under the TestApp project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: gem 'asdawqw', '~> 2.1.1'

Add references of the Gemfile

3. Adding a new Rails Controller

Once the TestApp project is created, a folder named controllers will be visible in the Project Explorer under the following path: TestApp > app > controllers. Right click on this folder and select New -> Run Rails Generator....

Run Rails Generator on Controllers Folder

Selecting the said option will popup a small window where the generator names are displayed. Here, select the controller template.

Create a new Controller

Next, a popup window will ask you for a Controller name and included Actions. For controller name provide Hello and include an action named Index and click OK.

Add a new Controller

A new controller class anmed HelloController will be created in a file named hello_controller.rb containing a method named Index. In this method, add code for initialization and a sample for its usage.

Initialize the library

How to Test

You can test the generated SDK and the server with automatically generated test cases as follows:

  1. From terminal/cmd navigate to the root directory of the SDK.
  2. Invoke: bundle exec rake

Initialization

Authentication

In order to setup authentication and initialization of the API client, you need the following information.

Parameter Description
x_api_key Your PMS API key
jwt Token which need to be passed in every request as GET parameter. You will get this token in authorization response. Token is valid 1 hour.

API client can be initialized as following.

# Configuration parameters and credentials
x_api_key = 'x_api_key' # Your PMS API key
jwt = 'jwt' # Token which need to be passed in every request as GET parameter. You will get this token in authorization response. Token is valid 1 hour.

client = Asdawqw::AsdawqwClient.new(
  x_api_key: x_api_key,
  jwt: jwt
)

The added initlization code can be debugged by putting a breakpoint in the Index method and running the project in debug mode by selecting Run -> Debug 'Development: TestApp'.

Debug the TestApp

Class Reference

List of Controllers

Class: AuthorizationController

Get singleton instance

The singleton instance of the AuthorizationController class can be accessed from the API Client.

authorization_controller = client.authorization

Method: get_login

Tags: Skips Authentication

In order to begin utilizing the platform APIs, your application must be authenticated and authorized to access domain resources. Follow the URL with your credentials and obtain an authorization token which is used in every request. You will have 2 types of tokens. One is on the PMS level, and this one should be used when you send requests related to PMS/PM data. For managing properties, you will need a token on PM level, with PM credentials. For every API call it will be noted which API credentials you should use.

def (username,
                  password); end

Parameters

Parameter Tags Description
username Required Your account email address (for PMS or PM)
password Required Your password

Example Usage

username = '[email protected]'
password = 'password'

result = authorization_controller.(username, password)

Back to List of Controllers

Class: PropertyManagersController

Get singleton instance

The singleton instance of the PropertyManagersController class can be accessed from the API Client.

propertyManagers_controller = client.property_managers

Method: get_pms_list

This API call will return a list of property managers (PM) that have been created in the BookingPal platform that is associated with your PMS. In all requests in this API section, you need to use your PMS credentials.

def get_pms_list; end

Example Usage


result = propertyManagers_controller.get_pms_list()

Method: create_new_property_manager

This API call will allow the PMS to pass all data to BookingPal that is required for registering a new PM (Property Manager). All fields are mandatory - PMS must pass this data in order for a PM account to be created. You need to use PMS credentials for this request.

def create_new_property_manager(content_type,
                                    body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"companyDetails\": {\r\n      \"accountId\": \"132\",\r\n      \"companyName\": \"Test PM\",\r\n      \"language\": \"en\",\r\n      \"fullName\": \"Test PM\",\r\n      \"companyAddress\": {\r\n        \"country\": \"US\",\r\n        \"state\": \"Test State\",\r\n        \"streetAddress\": \"Test Street\",\r\n        \"city\": \"Test City\",\r\n        \"zip\": \"13245\"\r\n      },\r\n      \"website\": \"www.testsite.com\",\r\n      \"email\": \"[email protected]\",\r\n      \"phone\": {\r\n        \"countryCode\": \"+321\",\r\n        \"number\": \"132456\"\r\n      },\r\n      \"password\": \"password\",\r\n      \"currency\": \"USD\"\r\n    },\r\n    \"policies\": {\r\n      \"paymentPolicy\": {\r\n        \"type\": \"SPLIT\",\r\n        \"splitPayment\": {\r\n          \"depositType\": \"FLAT\",\r\n          \"value\": 4.0,\r\n          \"secondPaymentDays\": 30\r\n        }\r\n      },\r\n      \"cancellationPolicy\": {\r\n        \"type\": \"MANUAL\",\r\n        \"manualPolicy\": {\r\n          \"type\": \"FLAT\",\r\n          \"manualPolicies\": [\r\n            {\r\n              \"chargeValue\": 20,\r\n              \"beforeDays\": 34,\r\n              \"cancellationFee\": 1.0\r\n            },\r\n            {\r\n              \"chargeValue\": 12,\r\n              \"beforeDays\": 45,\r\n              \"cancellationFee\": 2.0\r\n            }\r\n          ]\r\n        }\r\n      },\r\n      \"feeTaxMandatory\": {\r\n        \"isFeeMandatory\": true,\r\n        \"isTaxMandatory\": true\r\n      },\r\n      \"terms\": \"www.test.com\",\r\n      \"checkInTime\": \"10:00:00\",\r\n      \"checkOutTime\": \"16:00:00\",\r\n      \"leadTime\": 2\r\n    },\r\n    \"payment\": {\r\n      \"paymentType\": \"MAIL_CHECK\",\r\n      \"creditCard\": {\r\n        \"creditCardType\": \"POST\",\r\n        \"paymentGateways\": {\r\n          \"paymentGatewaysType\": \"AUTHORIZE_NET\",\r\n          \"user\": \"test\",\r\n          \"secret\": \"test\",\r\n          \"additionalField1\": \"\",\r\n          \"additionalField2\": \"\"\r\n        },\r\n        \"creditCardList\": [\r\n          \"AMERICAN_EXPRESS\",\r\n          \"DINERS_CLUB\"\r\n        ]\r\n      }\r\n    }\r\n  }\r\n}";
body = JSON.parse(body_value);

result = propertyManagers_controller.create_new_property_manager(content_type, body)

Method: get_property_manager_detail_data

This function will return a property manager’s details that belong to the current user. You need to use your PMS API credentials.

Request Body parameters are the same as for creating PM.

Response is the same as in creating a Property Manager function. Here you do not need to pass all root level fields, but if some are used - all fields inside are mandatory:

  • in CompanyDetails Model you can pass any field, and none of them is mandatory
  • in Policies Model - you can pass any field, and none of them is mandatory
  • if you do use PaymentPolicy - all fields inside are mandatory
  • if you do use CancellationPolicy - all fields inside are mandatory
  • if you use Payment Model - all fields inside are mandatory
def get_property_manager_detail_data(content_type,
                                         id); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
id Required Property Manager ID

Example Usage

content_type = 'application/json'
id = 'id'

result = propertyManagers_controller.get_property_manager_detail_data(content_type, id)

Method: update_property_manager_details

This function will update a property manager’s details. In case of an update you do not need to pass all information, but if you have values in one section - all fields inside are mandatory.

def update_property_manager_details(content_type,
                                        body,
                                        id); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description
id Required Property Manager ID

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"companyDetails\": {\r\n      \"accountId\": \"132\",\r\n      \"companyName\": \"Update Name\",\r\n      \"language\": \"en\",\r\n      \"fullName\": \"Update Full Name\",\r\n      \"companyAddress\": {\r\n        \"country\": \"US\",\r\n        \"state\": \"Update State\",\r\n        \"streetAddress\": \"Update Street\",\r\n        \"city\": \"Update City\",\r\n        \"zip\": \"13245\"\r\n      },\r\n      \"website\": \"www.updatesite.com\",\r\n      \"email\": \"[email protected]\",\r\n      \"phone\": {\r\n        \"countryCode\": \"+321\",\r\n        \"number\": \"132456\"\r\n      },\r\n      \"password\": \"password\",\r\n      \"currency\": \"USD\"\r\n    },\r\n    \"policies\": {\r\n      \"paymentPolicy\": {\r\n        \"type\": \"SPLIT\",\r\n        \"splitPayment\": {\r\n          \"depositType\": \"FLAT\",\r\n          \"value\": 4.0,\r\n          \"secondPaymentDays\": 30\r\n        }\r\n      },\r\n      \"cancellationPolicy\": {\r\n        \"type\": \"MANUAL\",\r\n        \"manualPolicy\": {\r\n          \"type\": \"FLAT\",\r\n          \"manualPolicies\": [\r\n            {\r\n              \"chargeValue\": 20,\r\n              \"beforeDays\": 34,\r\n              \"cancellationFee\": 1.0\r\n            },\r\n            {\r\n              \"chargeValue\": 12,\r\n              \"beforeDays\": 45,\r\n              \"cancellationFee\": 2.0\r\n            }\r\n          ]\r\n        }\r\n      },\r\n      \"feeTaxMandatory\": {\r\n        \"isFeeMandatory\": true,\r\n        \"isTaxMandatory\": true\r\n      },\r\n      \"terms\": \"www.test.com\",\r\n      \"checkInTime\": \"10:00:00\",\r\n      \"checkOutTime\": \"16:00:00\",\r\n      \"leadTime\": 2\r\n    },\r\n    \"payment\": {\r\n      \"paymentType\": \"MAIL_CHECK\",\r\n      \"creditCard\": {\r\n        \"creditCardType\": \"POST\",\r\n        \"paymentGateways\": {\r\n          \"paymentGatewaysType\": \"AUTHORIZE_NET\",\r\n          \"user\": \"test\",\r\n          \"secret\": \"test\",\r\n          \"additionalField1\": \"\",\r\n          \"additionalField2\": \"\"\r\n        },\r\n        \"creditCardList\": [\r\n          \"AMERICAN_EXPRESS\",\r\n          \"DINERS_CLUB\"\r\n        ]\r\n      }\r\n    }\r\n  }\r\n}";
body = JSON.parse(body_value);
id = 'id'

result = propertyManagers_controller.update_property_manager_details(content_type, body, id)

Back to List of Controllers

Class: ProductController

Get singleton instance

The singleton instance of the ProductController class can be accessed from the API Client.

product_controller = client.product

Method: get_product_list

This API call will return a list of properties that belong to the current user. This means that a user has to be logged in with products created already. Every API call in this section should be with PM credentials.

def get_product_list; end

Example Usage


result = product_controller.get_product_list()

Method: create_product

This function allows a logged in user to create new product. You can only send one product in each request.

def create_product(content_type,
                       body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"name\": \"Test product\",\r\n    \"rooms\": 5,\r\n    \"livingRoom\": 2,\r\n    \"bathrooms\": 4,\r\n    \"toilets\": 2,\r\n    \"totalBeds\": 6,\r\n    \"supportedLosRates\": false,\r\n    \"space\": 111.0,\r\n    \"spaceUnit\": \"SQ_FT\",\r\n    \"persons\": 10,\r\n    \"childs\": 2,\r\n    \"latitude\": 41.886125,\r\n    \"longitude\": -87.634233,\r\n    \"currency\": \"EUR\",\r\n    \"location\": {\r\n      \"postalCode\": \"60606\",\r\n      \"country\": \"US\",\r\n      \"region\": \"Illinois\",\r\n      \"city\": \"Chicago\",\r\n      \"street\": \"210 North Wells Street\",\r\n      \"zipCode9\": \"60606-1330\"\r\n    },\r\n    \"propertyType\": \"PCT34\",\r\n    \"attributesWithQuantity\": [\r\n      {\r\n        \"attributeId\": \"HAC312\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA107\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA11\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA149\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA163\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA18\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA19\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA251\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA273\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA32\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA41\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA5085\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA59\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA6058\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA68\",\r\n        \"quantity\": 1\r\n      },\r\n      {\r\n        \"attributeId\": \"RMA88\",\r\n        \"quantity\": 1\r\n      }\r\n    ],\r\n    \"notes\": {\r\n      \"description\": {\r\n        \"texts\": [\r\n          {\r\n            \"language\": \"EN\",\r\n            \"value\": \"Main description on EN!\"\r\n          },\r\n          {\r\n            \"language\": \"ES\",\r\n            \"value\": \"Main description on ES!\"\r\n          }\r\n        ]\r\n      },\r\n      \"houseRules\": {\r\n        \"texts\": [\r\n          {\r\n            \"language\": \"EN\",\r\n            \"value\": \"House Rules on EN!\"\r\n          },\r\n          {\r\n            \"language\": \"SR\",\r\n            \"value\": \"House Rules on SR!\"\r\n          }\r\n        ]\r\n      }\r\n    },\r\n    \"bedroomConfiguration\": {\r\n      \"bedrooms\": [\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA113\",\r\n                \"count\": 1\r\n              },\r\n              {\r\n                \"bedType\": \"RMA58\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Bedroom\",\r\n          \"privateBathroom\": false\r\n        },\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA113\",\r\n                \"count\": 1\r\n              },\r\n              {\r\n                \"bedType\": \"RMA58\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Bedroom\",\r\n          \"privateBathroom\": false\r\n        },\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA113\",\r\n                \"count\": 1\r\n              },\r\n              {\r\n                \"bedType\": \"RMA86\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Bedroom\",\r\n          \"privateBathroom\": false\r\n        },\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA113\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Bedroom\",\r\n          \"privateBathroom\": false\r\n        },\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA113\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Bedroom\",\r\n          \"privateBathroom\": false\r\n        },\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA58\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Bedroom\",\r\n          \"privateBathroom\": true\r\n        },\r\n        {\r\n          \"beds\": {\r\n            \"bed\": [\r\n              {\r\n                \"bedType\": \"RMA58\",\r\n                \"count\": 1\r\n              }\r\n            ]\r\n          },\r\n          \"type\": \"Living Room\",\r\n          \"privateBathroom\": false\r\n        }\r\n      ]\r\n    },\r\n    \"policy\": {\r\n      \"internetPolicy\": {\r\n        \"accessInternet\": true,\r\n        \"kindOfInternet\": \"WiFi\",\r\n        \"availableInternet\": \"AllAreas\",\r\n        \"chargeInternet\": \"Free\"\r\n      },\r\n      \"parkingPolicy\": {\r\n        \"accessParking\": true,\r\n        \"locatedParking\": \"OnSite\",\r\n        \"privateParking\": true,\r\n        \"chargeParking\": \"$ 150\",\r\n        \"timeCostParking\": \"PerStay\",\r\n        \"necessaryReservationParking\": \"NotPossible\"\r\n      },\r\n      \"petPolicy\": {\r\n        \"allowedPets\": \"Allowed\",\r\n        \"chargePets\": \"Free\"\r\n      },\r\n      \"childrenAllowed\": true,\r\n      \"smokingAllowed\": false\r\n    },\r\n    \"checkInTime\": \"16:00:00\",\r\n    \"checkInToTime\": \"20:00:00\",\r\n    \"checkOutTime\": \"10:00:00\"\r\n  }\r\n}";
body = JSON.parse(body_value);

result = product_controller.create_product(content_type, body)

Method: update_product

This function allows a logged in user to update product details.

Request parameters and request example will be the same as in the create product API. The only field that must be added is the product id.

You need to have all other parameters which were used in the create API call that you want to keep (AltID can’t be updated). Everything that you do not send as an update will be deleted (overwritten).

Response parameters and response examples are the same as in the create product API.

def update_product(content_type,
                       body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{  \"data\": {    \"name\": \"Name Updated\",    \"id\": 1235124634,    \"altId\": 23767,    \"rooms\": 3,    \"livingRoom\": 6,    \"bathrooms\": 6,    \"toilets\": 6,    \"totalBeds\": 6,    \"space\": 66,    \"spaceUnit\": \"SQ_M\",    \"persons\": 6,    \"childs\": 6,    \"latitude\": 41.8860812,    \"longitude\": -87.634233,    \"supportedLosRates\": false,    \"currency\": \"RSD\",    \"propertyType\": \"PCT101\",    \"nearbyAmenities\": [      {        \"attributeId\": \"ACC203\",        \"distance\": 3      }    ],    \"attributesWithQuantity\": [      {        \"attributeId\": \"RMA149\",        \"quantity\": 1      }    ],    \"notes\": {      \"description\": {        \"texts\": [          {            \"language\": \"FR\",            \"value\": \"Main description in FR!\"          },          {            \"language\": \"sr\",            \"value\": \"Main description in RO!\"          }        ]      },      \"houseRules\": {        \"texts\": [          {            \"language\": \"RO\",            \"value\": \"House Rules in RO!\"          },          {            \"language\": \"SK\",            \"value\": \"House Rules in SK!\"          }        ]      }    },    \"bedroomConfiguration\": {      \"bedrooms\": [        {          \"beds\": {            \"bed\": [              {                \"bedType\": \"RMA6118\",                \"count\": 2              },              {                \"bedType\": \"RMA6120\",                \"count\": 4              }            ]          },          \"type\": \"Living Room\",          \"privateBathroom\": true        },        {          \"beds\": {            \"bed\": [              {                \"bedType\": \"RMA102\",                \"count\": 2              },              {                \"bedType\": \"RMA58\",                \"count\": 2              },              {                \"bedType\": \"RMA6119\",                \"count\": 3              }            ]          },          \"type\": \"Bedroom\",          \"privateBathroom\": true        }      ]    },    \"policy\": {      \"internetPolicy\": {        \"accessInternet\": true,        \"kindOfInternet\": \"Wired\",        \"availableInternet\": \"SomeRooms\",        \"chargeInternet\": \"$ 1000\"      },      \"parkingPolicy\": {        \"accessParking\": true,        \"locatedParking\": \"Nearby\",        \"privateParking\": false,        \"chargeParking\": \"$ 100\",        \"timeCostParking\": \"PerHour\",        \"necessaryReservationParking\": \"NotPossible\"      },      \"petPolicy\": {        \"allowedPets\": \"NotAllowed\",        \"chargePets\": \"$ 10\"      },      \"childrenAllowed\": false,      \"smokingAllowed\": false    },    \"checkInTime\": \"17:00:00\",    \"checkInToTime\": \"21:00:00\",    \"checkOutTime\": \"11:00:00\"  }}";
body = JSON.parse(body_value);

result = product_controller.update_product(content_type, body)

Method: get_product_by_id

This function allows logged in user to get a specific product.

def get_product_by_id(product_id); end

Parameters

Parameter Tags Description
product_id Required Id of the property

Example Usage

product_id = 'productId'

result = product_controller.get_product_by_id(product_id)

Method: delete_product

This function allows the logged in user to delete product.

def delete_product(product_id); end

Parameters

Parameter Tags Description
product_id Required Property ID

Example Usage

product_id = 'productId'

result = product_controller.delete_product(product_id)

Method: delete_list_product

This function allows logged in user to delete list of products.

def delete_list_product(content_type,
                            body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": [\r\n    1235124636,\r\n    1235124637\r\n  ]\r\n}";
body = JSON.parse(body_value);

result = product_controller.delete_list_product(content_type, body)

Method: create_activation_list_product

This function allows logged in user to activate a list of products in BookingPal. Products MUST be activated successfully before they can be distributed to any channel.

Note: When a product is successfully activated it will be queued for the internal BP validation function and you will receive async push messages when the validation is completed - like it is described in the Validation section.

def create_activation_list_product(content_type,
                                       body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": [\r\n    1235124634,\r\n    1235124636\r\n  ]\r\n}";
body = JSON.parse(body_value);

result = product_controller.create_activation_list_product(content_type, body)

Method: create_deactivation_list_product

This function allows the logged in user to deactivate a list of products. This function will also close the calendars on every channel the products have been listed on.

def create_deactivation_list_product(content_type,
                                         body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": [\r\n    1235124634,\r\n    1235124636\r\n  ]\r\n}";
body = JSON.parse(body_value);

result = product_controller.create_deactivation_list_product(content_type, body)

Back to List of Controllers

Class: ImagesController

Get singleton instance

The singleton instance of the ImagesController class can be accessed from the API Client.

images_controller = client.images

Method: get_image_list_by_product_id

This function allows logged in user to get image list for the existing product

def get_image_list_by_product_id(product_id); end

Parameters

Parameter Tags Description
product_id Required ID of the property

Example Usage

product_id = 'productId'

result = images_controller.get_image_list_by_product_id(product_id)

Method: create_images

This function allows the logged in user to upload images for the existing product. Every new image will be sorted to the end. The first image sent will be used as the “Main Image”. (Image re-ordering can also be done within the BookingPal platform manually by users)

def create_images(content_type,
                      body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{ \t\"data\": { \t\t\"productId\": 1235124634, \t\t\"image\": { \t\t\t\"url\": \"http://aff.bstatic.com/images/hotel/max500/110/11069097.jpg\", \t\t\t\"tags\": [ \t\t\t\t4, \t\t\t\t5, \t\t\t\t6 \t\t\t] \t\t} \t} }";
body = JSON.parse(body_value);

result = images_controller.create_images(content_type, body)

Method: delete_list_of_images

This function allows the logged in user to delete image(s) from the existing product.

def delete_list_of_images(content_type,
                              body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"productId\": 1235124634,\r\n    \"images\": [\r\n      {\r\n        \"url\": \"https://aff.bstatic.com/images/hotel/max500/110/11069102.jpg\"\r\n      }\r\n    ]\r\n  }\r\n}";
body = JSON.parse(body_value);

result = images_controller.delete_list_of_images(content_type, body)

Method: delete_all_images_per_property

This function allows logged in user to delete images.

def delete_all_images_per_property(content_type,
                                       product_id); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
product_id Required ID of property for which you want to delete all images

Example Usage

content_type = 'application/json'
product_id = 'productId'

result = images_controller.delete_all_images_per_property(content_type, product_id)

Back to List of Controllers

Class: RatesAndAvailabilityController

Get singleton instance

The singleton instance of the RatesAndAvailabilityController class can be accessed from the API Client.

ratesAndAvailability_controller = client.rates_and_availability

Method: get_rates_and_availability_product_id

This function allows logged in users to get rates and availability for the specific product. Every API call in this section should be with PM credentials.

def get_rates_and_availability_product_id(content_type,
                                              product_id); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
product_id Required ID of the property

Example Usage

content_type = 'application/json'
product_id = 'productId'

result = ratesAndAvailability_controller.get_rates_and_availability_product_id(content_type, product_id)

Method: create_and_update_rates_and_availability

Create and update calls are the same. When data is sent, if the data already exists in BookingPal - that data will be updated. Otherwise it will be created (inserted). If you want to update data for some period, you should just send data for these dates. All other data (for other dates) will remain untouched. This allows you to update only changed periods and we will not delete previously sent data for other periods.

In the case of a first data push, all data for one property should be sent in one request. When making updates or changes to existing data, then all changed data should be sent in one request.

Note: if property is set to use LOS rates (supportedLosRates) - only field leadTime, array availableCount and availability can be updated in this API call (for MLT property). For SGL property only leadTime and availability can be updated. This API call can not be used for OWN properties. Important: Maximum allowed end date in any data type is 3 years in future.

Every API call in this section should be with PM credentials.

def create_and_update_rates_and_availability(content_type,
                                                 body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"productId\": 1235124634,\r\n    \"leadTime\": 2,\r\n    \"rates\": [\r\n      {\r\n        \"beginDate\": \"2020-01-20\",\r\n        \"endDate\": \"2021-01-25\",\r\n        \"amount\": 137.0\r\n      }\r\n    ],\r\n    \"minStays\": [\r\n      {\r\n        \"beginDate\": \"2020-01-20\",\r\n        \"endDate\": \"2021-01-25\",\r\n        \"minStay\": 5\r\n      }\r\n    ],\r\n    \"maxStays\": [\r\n      {\r\n        \"beginDate\": \"2020-01-20\",\r\n        \"endDate\": \"2021-01-25\",\r\n        \"maxStay\": 20\r\n      }\r\n    ],\r\n    \"restrictions\": [\r\n      {\r\n        \"beginDate\": \"2020-01-20\",\r\n        \"endDate\": \"2021-01-25\",\r\n        \"checkIn\": {\r\n          \"monday\": false,\r\n          \"tuesday\": false,\r\n          \"wednesday\": false,\r\n          \"thursday\": false,\r\n          \"friday\": false,\r\n          \"saturday\": true,\r\n          \"sunday\": true\r\n        },\r\n        \"checkOut\": {\r\n          \"monday\": false,\r\n          \"tuesday\": false,\r\n          \"wednesday\": false,\r\n          \"thursday\": false,\r\n          \"friday\": false,\r\n          \"saturday\": true,\r\n          \"sunday\": true\r\n        }\r\n      }\r\n    ],\r\n    \"availabilities\": [\r\n      {\r\n        \"beginDate\": \"2020-04-20\",\r\n        \"endDate\": \"2020-04-25\",\r\n        \"availability\": false\r\n      },\r\n      {\r\n        \"beginDate\": \"2020-04-26\",\r\n        \"endDate\": \"2020-04-28\",\r\n        \"availability\": true\r\n      }\r\n    ],\r\n    \"availableCount\": [\r\n      {\r\n        \"beginDate\": \"2020-04-20\",\r\n        \"endDate\": \"2020-04-25\",\r\n        \"count\": 3\r\n      },\r\n      {\r\n        \"beginDate\": \"2020-04-26\",\r\n        \"endDate\": \"2020-04-28\",\r\n        \"count\": 4\r\n      }\r\n    ]\r\n  }\r\n}";
body = JSON.parse(body_value);

result = ratesAndAvailability_controller.create_and_update_rates_and_availability(content_type, body)

Back to List of Controllers

Class: LOSPricingController

Get singleton instance

The singleton instance of the LOSPricingController class can be accessed from the API Client.

lOSPricing_controller = client.los_pricing

Method: create_and_update_los_length_of_stay_pricing

Introduction: You can use this function if you would like to send BookingPal different prices for various Length of Stays with the same starting date.

LOS Pricing will be a different method in sending rates to BookingPal and is defined as pricing sent for a specific “Stay ranges”, In the LOS method you are setting specific rates based on the Length of Stay. (This is a different way to push rates to BookingPal. )

For date periods of 1 to 30 days a specific rate need to enter check-in date and a rate for every possible reservation starting at that date (i.e. 1 day, 2 days, up to 30 days, 30 days is the maximum value allowed for this field) you will need to send BookingPal total rate value for that period.

Maximum LOS number of days is 30. All other LOS values after 30 will not be saved. If you do not support reservation for some specific number of dates - send value 0.00 for this LOS number of days. Keep in mind that all values not sent for any specific check-in date will be considered as 0, and reservation for this number of days will not be possible.

Field maxGuests allows you to set different rates per different number of guests. If you do not have different rate values per number of guests - you can send the value for maximum number of guests, and all others will have the same rate.

For MLT properties which supported LOS price for update number of count you can use it rates and availability API.

It is suggested to manage availability over “rates and availability” API call, and to close/open dates over this call.

Note: this API call can be used only if you set supportedLosRates = true on the product. Otherwise using this API for specific product is not possible.

def create_and_update_los_length_of_stay_pricing(content_type,
                                                     body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"productId\": 1235124634,\r\n    \"losRates\": [\r\n      {\r\n        \"checkInDate\": \"2020-06-20\",\r\n        \"maxGuests\": 3,\r\n        \"losValue\": [\r\n          100.0,\r\n          150.0,\r\n          200.0,\r\n          250.0,\r\n          300.0,\r\n          0.0,\r\n          0.0,\r\n          450.0,\r\n          500.0,\r\n          550.0,\r\n          600.0,\r\n          650.0,\r\n          700.0,\r\n          750.0,\r\n          800.0,\r\n          850.0,\r\n          900.0,\r\n          950.0,\r\n          550.0,\r\n          510.0,\r\n          570.0,\r\n          520.0,\r\n          500.0,\r\n          510.0,\r\n          590.0,\r\n          121.0,\r\n          122.0,\r\n          123.0\r\n        ]\r\n      },\r\n      {\r\n        \"checkInDate\": \"2020-05-21\",\r\n        \"currency\": \"USD\",\r\n        \"maxGuests\": 4,\r\n        \"losValue\": [\r\n          111.0,\r\n          112.0,\r\n          123.0,\r\n          250.0,\r\n          300.0,\r\n          350.0,\r\n          400.0,\r\n          450.0,\r\n          500.0,\r\n          550.0,\r\n          600.0,\r\n          650.0,\r\n          700.0,\r\n          750.0,\r\n          800.0,\r\n          850.0,\r\n          900.0,\r\n          950.0,\r\n          550.0,\r\n          510.0,\r\n          570.0,\r\n          520.0,\r\n          500.0,\r\n          510.0,\r\n          590.0,\r\n          580.0,\r\n          560.0,\r\n          540.0\r\n        ]\r\n      }\r\n    ]\r\n  }\r\n}";
body = JSON.parse(body_value);

result = lOSPricing_controller.create_and_update_los_length_of_stay_pricing(content_type, body)

Method: get_los_prices_list_by_product_id

This function allows the logged in user to get a LOS rate for property.

def get_los_prices_list_by_product_id(product_id); end

Parameters

Parameter Tags Description
product_id Required Property ID in BookingPal

Example Usage

product_id = 'productId'

result = lOSPricing_controller.get_los_prices_list_by_product_id(product_id)

Back to List of Controllers

Class: FeeAndTaxController

Get singleton instance

The singleton instance of the FeeAndTaxController class can be accessed from the API Client.

feeAndTax_controller = client.fee_and_tax

Method: get_fee_and_tax_list_by_product_id

This function allows the logged in user to get a fee list for the specific product.

def get_fee_and_tax_list_by_product_id(product_id); end

Parameters

Parameter Tags Description
product_id Required ID of the property

Example Usage

product_id = 'productId'

result = feeAndTax_controller.get_fee_and_tax_list_by_product_id(product_id)

Method: create_fee_and_tax

This function allows the logged in user to set fees (i.e. cleaning fee, damage waiver, extra bed, extra person etc.) and taxes for the specific product. Here, you always need to send all fees and taxes for one property. All fees or taxes which were in our system for that property and which are not in the new request will be deleted. Taxes in the BookingPal system will always have percent value.

If you want to delete all fees and/or taxes for one property (if you do not have fees and taxes in your system for one property) send an empty list of fees and.or taxes. In short when you use this request you need to always send us a full list of fees and taxes per property, since we will do a full update.

def create_fee_and_tax(content_type,
                           body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"productId\": 1235124634,\r\n    \"fees\": [\r\n      {\r\n        \"entityType\": \"OPTIONAL\",\r\n        \"feeType\": \"GENERAL\",\r\n        \"option\": 3,\r\n        \"name\": \"RetestFeeHF\",\r\n        \"beginDate\": \"2020-02-26\",\r\n        \"endDate\": \"2020-12-12\",\r\n        \"taxType\": \"TAXABLE\",\r\n        \"unit\": \"PER_DAY_PER_PERSON_EXTRA\",\r\n        \"value\": 88,\r\n        \"valueType\": \"PERCENT\"\r\n      }\r\n    ],\r\n    \"taxes\": [\r\n      {\r\n        \"name\": \"Tax reTestAT\",\r\n        \"type\": \"SalesTaxIncluded\",\r\n        \"value\": 55,\r\n        \"altId\": \"11\"\r\n      }\r\n    ]\r\n  }\r\n}";
body = JSON.parse(body_value);

result = feeAndTax_controller.create_fee_and_tax(content_type, body)

Back to List of Controllers

Class: FeeAndTaxMandatoryAtThePropertyLevelController

Get singleton instance

The singleton instance of the FeeAndTaxMandatoryAtThePropertyLevelController class can be accessed from the API Client.

feeAndTaxMandatoryAtThePropertyLevel_controller = client.fee_and_tax_mandatory_at_the_property_level

Method: get_fee_and_tax_mandatory

This function allows the logged in user to get info about current set for all PM properties are fees/taxes set to be mandatory or not.

def get_fee_and_tax_mandatory; end

Example Usage


result = feeAndTaxMandatoryAtThePropertyLevel_controller.get_fee_and_tax_mandatory()

Method: create_import_or_update_fee_and_tax_mandatory

This function allows the logged in user to import or update a fee and tax mandatory.

def create_import_or_update_fee_and_tax_mandatory(content_type,
                                                      body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"validationSettings\": [\r\n      {\r\n        \"productId\": 1235124634,\r\n        \"isFeeMandatory\": false,\r\n        \"isTaxMandatory\": false\r\n      }\r\n    ]\r\n  }\r\n}";
body = JSON.parse(body_value);

result = feeAndTaxMandatoryAtThePropertyLevel_controller.create_import_or_update_fee_and_tax_mandatory(content_type, body)

Method: create_remove_validation_settings

This function allows the logged in user to remove any setup on property level and to return on default (which is that fee/taxes are mandatory). This API call will accept a list of properties.

def create_remove_validation_settings(content_type,
                                          body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": [\r\n    1235124634\r\n  ]\r\n}";
body = JSON.parse(body_value);

result = feeAndTaxMandatoryAtThePropertyLevel_controller.create_remove_validation_settings(content_type, body)

Back to List of Controllers

Class: YieldsController

Get singleton instance

The singleton instance of the YieldsController class can be accessed from the API Client.

yields_controller = client.yields

Method: get_ymr_list_by_product_id

This function allows the logged in user to get yield management rules list of the specific product.

def get_ymr_list_by_product_id(product_id); end

Parameters

Parameter Tags Description
product_id Required ID of the property

Example Usage

product_id = 'productId'

result = yields_controller.get_ymr_list_by_product_id(product_id)

Method: create_ymr

This function allows the logged-in user to add yield management rules for the specific product. Yield management rules can affect the final price of the property depending on some special conditions (like the length of stay, early booking, etc.). These rules automate price manipulations, on an inquiry by inquiry basis. When set criteria are met, they help maximize revenue and occupancy.

How is the price calculated? The price for a night is calculated based on the basic price and the yield management rules.

  • If no YMR: price per night = price per night
  • If YMR is set it can Increase/decrease percent or increase/decrease amount: price per night + amount = per night or price per night - amount = per night

The below examples will use the scenario to walk you step by step and explain how the price is calculated based on different YMRs. Let’s say that the basic price per night for 2016 is 100 USD.

This function is used also for updating yield. So if you already create a specific yield for some date - and you send a new one - we will update the yield for this date. If you need to delete a specific yield type - you can send an empty list for that type.

Important: The maximum allowed end date is 3 years in the future.

def create_ymr(content_type,
                   body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"productId\": 1235124634,\r\n    \"weekend\": [\r\n      {\r\n        \"beginDate\": \"2020-02-10\",\r\n        \"endDate\": \"2021-02-15\",\r\n        \"amount\": 18.0,\r\n        \"modifier\": \"DECREASE_PERCENT\",\r\n        \"weekendParam\": \"DAYS_OF_WEEKEND_SAT_SUN\"\r\n      }\r\n    ],\r\n    \"lengthOfStay\": [\r\n      {\r\n        \"beginDate\": \"2020-02-10\",\r\n        \"endDate\": \"2021-02-15\",\r\n        \"amount\": 34.0,\r\n        \"modifier\": \"INCREASE_AMOUNT\",\r\n        \"param\": 7\r\n      }\r\n    ],\r\n    \"dateRange\": [\r\n      {\r\n        \"beginDate\": \"2020-04-10\",\r\n        \"endDate\": \"2020-04-15\",\r\n        \"amount\": 35.0,\r\n        \"modifier\": \"INCREASE_AMOUNT\"\r\n      },\r\n      {\r\n        \"beginDate\": \"2020-05-16\",\r\n        \"endDate\": \"2020-05-25\",\r\n        \"amount\": 25.0,\r\n        \"modifier\": \"INCREASE_PERCENT\"\r\n      }\r\n    ]\r\n  }\r\n}";
body = JSON.parse(body_value);

result = yields_controller.create_ymr(content_type, body)

Back to List of Controllers

Class: ValidationController

Get singleton instance

The singleton instance of the ValidationController class can be accessed from the API Client.

validation_controller = client.validation

Method: get_booking_pal_validation_job_full_pm

This function will allow the PMC to call the BookingPal property validation job for all properties identified which belong to the current user. Authorization token should be on PM level. Also we will run validation only for properties which are activated. If you deactivate property - we will not validate this property.

After the request you will get a response indicating if messages were processed or not. If the request is good your request for the validator job will be put into a queue. Once the request is processed, BookingPal will send an async push message per property informing the user if a property is valid or not, and if it is not valid - with reasons why the validation failed. This message will be sent on the endpoint which was entered in section Push Notifications, field asyncPush.

Note: If the property is distributed already on some channel - this property will not be moved to an Incomplete state. Also if you have property on Incomplete state because of some reason, and you update this data which causes that property is on ‘Incomplete’ property will not be moved automatically to a valid state. Instead, you should run a Validation job manually for that property or wait for our automatic validation job which we are running once per day.

To make the property ready for Onboarding you should run validation first. if the property is valid - it will be ready for onboarding. Otherwise - the property will be in Incomplete state. Also, we will run validation only for properties that are activated. If you deactivate property - we will not validate this property.

def get_booking_pal_validation_job_full_pm; end

Example Usage


result = validation_controller.get_booking_pal_validation_job_full_pm()

Method: create_booking_pal_validation_job_list_of_properties

This function will allow the PMS to call the BookingPal property validation job for a list of properties from request. These properties must belong to the current user and authorization token should be on PM level. Also, we will run validation only for properties that are activated. If you deactivate property - we will not validate this property.

def create_booking_pal_validation_job_list_of_properties(content_type,
                                                             body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{  \"data\": {    \"productIds\": [1235124634]  }}";
body = JSON.parse(body_value);

result = validation_controller.create_booking_pal_validation_job_list_of_properties(content_type, body)

Back to List of Controllers

Class: TestingOfMessageAPICallsController

Get singleton instance

The singleton instance of the TestingOfMessageAPICallsController class can be accessed from the API Client.

testingOfMessageAPICalls_controller = client.testing_of_message_api_calls

Method: get_test_message_threads

This function allows the logged in user to get all message threads or message threads with an unresponded message from guest for the whole PM. You need to use PM credentials. There is also paging as optional values. If you do not pass this value, we will return the first page and 10 threads per page.

Since API calls for messages depend on channel connections and these values will exist in BookingPal only if guests on channel create some message, these calls can work only on production. So for testing purposes we’ve built an additional endpoint with the same API calls where you will be able to test these calls.

Note: To be able to test these calls, you need to have at least 1 property, since we will in response return you messages for 1 property from your PM.

def get_test_message_threads(page,
                                 limit,
                                 thread_type); end

Parameters

Parameter Tags Description
page Required TODO: Add a parameter description
limit Required TODO: Add a parameter description
thread_type Required Request all threads or only threads with unanswered message new,all

Example Usage

page = 35
limit = 35
thread_type = 'threadType'

result = testingOfMessageAPICalls_controller.get_test_message_threads(page, limit, thread_type)

Method: get_test_message_list_for_specific_thread

Since API calls for messages depend on channel connections and these values will exist in BookingPal only if guests on channel create some message, these calls can work only on production. So for testing purposes, we’ve built an additional endpoint with the same API calls where you will be able to test these calls.

This function allows the logged-in user to get a list of all messages from passed thread Id. You need to use PM credentials

Note: To be able to test these calls, you need to have at least 1 property, since we will in response return you messages for 1 property from your PM.

def get_test_message_list_for_specific_thread(thread_id); end

Parameters

Parameter Tags Description
thread_id Required ID of thread

Example Usage

thread_id = 'threadId'

result = testingOfMessageAPICalls_controller.get_test_message_list_for_specific_thread(thread_id)

Method: post_new_test_message_for_specific_thread

This function will allow PM to post new messages in already existing threads. Since this call is only for testing - we will not actually save these passed values.

Since API calls for messages depend on channel connections and these values will exist in BookingPal only if guests on channel create some message, these calls can work only on production. So for testing purposes, we’ve built an additional endpoint with the same API calls where you will be able to test these calls.

Note: To be able to test these calls, you need to have at least 1 property, since we will in response return to you messages for 1 property from your PM.

def post_new_test_message_for_specific_thread(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body_value = "{\r\n  \"data\": {\r\n    \"threadId\": 5656,\r\n    \"message\": \"new message\",\r\n    \"productId\": 1235124634\r\n  }\r\n}";
body = JSON.parse(body_value);

result = testingOfMessageAPICalls_controller.post_new_test_message_for_specific_thread(body)

Back to List of Controllers

Class: MessagingController

Get singleton instance

The singleton instance of the MessagingController class can be accessed from the API Client.

messaging_controller = client.messaging

Method: get_message_threads

This function allows the logged in user to get all message threads or message threads with unresponded message from guest for whole PM. You need to use PM credentials. There is also paging as optional values. If you do not pass this value, we will return first page and 10 threads per page. And in heading you will get a link for the next page.

def get_message_threads(page,
                            limit,
                            thread_type); end

Parameters

Parameter Tags Description
page Required Number of current page
limit Required Limit of how many threads will be showed at one page
thread_type Required Request all threads or only threads with unanswered message new,all

Example Usage

page = 1
limit = 5
thread_type = 'threadType'

result = messaging_controller.get_message_threads(page, limit, thread_type)

Method: get_message_list_for_specific_thread

This function allows the logged in user to get a list of all messages from passed thread Id. You need to use PM credentials.

def get_message_list_for_specific_thread(thread_id); end

Parameters

Parameter Tags Description
thread_id Required ID of the thread

Example Usage

thread_id = 'threadId'

result = messaging_controller.get_message_list_for_specific_thread(thread_id)

Method: post_new_message_for_specific_thread

This function will allow PM to post new messages in already existing threads.

def post_new_message_for_specific_thread(content_type,
                                             body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"threadId\": 5656,\r\n    \"message\": \"New message\"\r\n  }\r\n}";
body = JSON.parse(body_value);

result = messaging_controller.post_new_message_for_specific_thread(content_type, body)

Back to List of Controllers

Class: RequestToBookController

Get singleton instance

The singleton instance of the RequestToBookController class can be accessed from the API Client.

requestToBook_controller = client.request_to_book

Method: create_request_to_book_answer_from_pms

This is an API call which you should use for accepting on avoiding requests to book.

def create_request_to_book_answer_from_pms(content_type,
                                               body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"requestToBookType\": \"ACCEPT\",\r\n    \"requestToBookDeclineReasonType\": \"DATES_NOT_AVAILABLE\",\r\n    \"declineMessageToGuest\": \"reTest request to book\",\r\n    \"reservationId\": 1235124634\r\n  }\r\n}";
body = JSON.parse(body_value);

result = requestToBook_controller.create_request_to_book_answer_from_pms(content_type, body)

Method: create_request_to_book_test

Since you can not get the request to book on our test environment (since this first needs to be created on the channel) We provide the possibility for PMS to test this request with some random filled data in our system. So when you call this API function - we will send you push notification for the request to book for a provided property ID.

def create_request_to_book_test(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body_value = "{\r\n  \"data\": {\r\n    \"action\": \"RESERVATION_REQUEST_VOIDED\",\r\n    \"productId\": 1235124634\r\n  }\r\n}";
body = JSON.parse(body_value);

result = requestToBook_controller.create_request_to_book_test(body)

Method: create_request_to_book_request

Tags: Skips Authentication

This will be a request which we will send to PMS when we get a request to book from the channel. So when BookingPal gets a new request to book request - we will push this POST request to the link which you set in BookingPal for your PMS (in Push Notification section - "requestToBook").

Important note: In this doc to be able to test this - you need to set a full URL on the Configure button in the right section.

def create_request_to_book_request(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body = RequestToBookRequestModel.new

result = requestToBook_controller.create_request_to_book_request(body)

Method: create_request_to_book_cancel_request

Tags: Skips Authentication

This will be a request which we will send to PMS when we get a request to book from the channel. So when BookingPal gets a new request to book request - we will push this POST request to the link which you set in BookingPal for your PMS (in Push Notification section - "requestToBook").

Important note: In this doc to be able to test this - you need to set a full URL on the Configure button in the right section.

def create_request_to_book_cancel_request(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body = RequestToBookCancelRequestModel.new

result = requestToBook_controller.create_request_to_book_cancel_request(body)

Back to List of Controllers

Class: PushNotificationController

Get singleton instance

The singleton instance of the PushNotificationController class can be accessed from the API Client.

pushNotification_controller = client.push_notification

Provide the links on which the requests about new reservation and cancel reservation will be sent. Links should be https.

These links should be set on PMS level, so please use your PMS credentials.

def create_push_notification_links(content_type,
                                       body); end

Parameters

Parameter Tags Description
content_type Required TODO: Add a parameter description
body Required TODO: Add a parameter description

Example Usage

content_type = 'application/json'
body_value = "{\r\n  \"data\": {\r\n    \"bookLink\": \"https://newreservationnotification.link\",\r\n    \"cancelLink\": \"https://cancelreservation.link\",\r\n    \"asyncPush\": \"https://asyncpush.link\",\r\n    \"requestToBook\": \"https://requestToBook.link\"\r\n  }\r\n}";
body = JSON.parse(body_value);

result = pushNotification_controller.create_push_notification_links(content_type, body)

This will return all notification URLs which are set. It will work on PMS level, so use PMS credentials.

def get_notification_links; end

Example Usage


result = pushNotification_controller.get_notification_links()

Back to List of Controllers

Class: ReservationNotificationsController

Get singleton instance

The singleton instance of the ReservationNotificationsController class can be accessed from the API Client.

reservationNotifications_controller = client.reservation_notifications

Method: get_reservation_by_product

This function allows logged-in users to get all reservations for the specific product.

def get_reservation_by_product(product_id); end

Parameters

Parameter Tags Description
product_id Required Product ID

Example Usage

product_id = 'productId'

result = reservationNotifications_controller.get_reservation_by_product(product_id)

Method: get_reservation_by_pm

This API call will return a list of reservations that belong to the current user.

def get_reservation_by_pm; end

Example Usage


result = reservationNotifications_controller.get_reservation_by_pm()

Method: new_reservation_notification_push

Tags: Skips Authentication

This function sends the request to the provided link about a new reservation. So when BookingPal gets a new reservation - we will push this POST request to the link which you set in BookingPal for your PMS (in Push Notification section).

Important note: In this doc to be able to test this - you need to set a full URL on the Configure button in the right section.

Note: Credit card data will be sent only if PMS should process payment in their system. Also, data that will be passed to PMS depends on channels - and do we get all of this data. So we have column ‘Mandatory’ to be aware that some data will be missing if we do not get them from a channel (like some guest address data). Additional note: Some channels support modification. At this moment we will process modification first by canceling the current reservation and then we will process the new regular reservation. In these cases for tracking purposes, you can use channel reservation ID (confirmationID) which should be the same in these cases.

def new_reservation_notification_push(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body = ReservationNotificationObject.new

result = reservationNotifications_controller.new_reservation_notification_push(body)

Method: create_reservation_cancellation_notification_push

Tags: Skips Authentication

This function sends the request to the provided link about the reservation cancellation. So when BookingPal gets a cancel reservation request from the channel - we will push this POST request to the link which you set in BookingPal for your PMS (in Push Notification section).

Important note: In this doc to be able to test this - you need to set a full URL on the Configure button in the right section.

def create_reservation_cancellation_notification_push(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body = CancelReservationNotificationObject.new

result = reservationNotifications_controller.create_reservation_cancellation_notification_push(body)

Back to List of Controllers

Class: AsynchronousPushMessagesController

Get singleton instance

The singleton instance of the AsynchronousPushMessagesController class can be accessed from the API Client.

asynchronousPushMessages_controller = client.asynchronous_push_messages

Method: create_validation_push_asynchronous_message

Tags: Skips Authentication

This is POST request - push notifications (webhooks) which BookingPal will send on PMS endpoint (which is set in push notification API, field - asyncPush) after something is executed in BP. This is necessary since some API calls like validation, onboarding, etc are done over queue in our system, so you will get an asynchronous response.

In these requests, we do not have expected responses from the PMS system. Since these are just notifications.

Important note: In this doc to be able to test this - you need to set a full URL on the Configure button in the right section.

def create_validation_push_asynchronous_message(body); end

Parameters

Parameter Tags Description
body Required TODO: Add a parameter description

Example Usage

body = ValidationAsynchronousPushMessageRequest.new

asynchronousPushMessages_controller.create_validation_push_asynchronous_message(body)

Back to List of Controllers