Python client library for Channel Management API
Project description
Getting started
Before beginning work it is necessary that:
- Your organization is registered and activated
- You have participated in a kickoff 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 paramjwt
)
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
You must have Python 2 >=2.7.9
or Python 3 >=3.4
installed on your system to install and run this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc.
These dependencies are defined in the requirements.txt
file that comes with the SDK.
To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps at https://pip.pypa.io/en/stable/installing/.
Python and PIP executables should be defined in your PATH. Open command prompt and type pip --version
.
This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.
- Using command line, navigate to the directory containing the generated files (including
requirements.txt
) for the SDK. - Run the command
pip install -r requirements.txt
. This should install all the required dependencies.
How to Use
The following section explains how to use the Apimaticcalculatorlatest SDK package in a new project.
1. Open Project in an IDE
Open up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
Click on Open
in PyCharm to browse to your generated SDK directory and then click OK
.
The project files will be displayed in the side bar as follows:
2. Add a new Test Project
Create a new directory by right clicking on the solution name as shown below:
Name the directory as "test"
Add a python file to this project with the name "testsdk"
Name it "testsdk"
In your python file you will be required to import the generated python library using the following code lines
from apimaticcalculatorlatest.apimaticcalculatorlatest_client import ApimaticcalculatorlatestClient
After this you can write code to instantiate an API client object, get a controller object and make API calls. Sample code is given in the subsequent sections.
3. Run the Test Project
To run the file within your test project, right click on your Python file inside your Test project and click on Run
How to Test
You can test the generated SDK and the server with automatically generated test cases. unittest is used as the testing framework and nose is used as the test runner. You can run the tests as follows:
- From terminal/cmd navigate to the root directory of the SDK.
- Invoke
pip install -r test-requirements.txt
- Invoke
nosetests
Initialization
Authentication
In order to setup authentication and initialization of the API client, you need the following information.
Parameter | Description |
---|---|
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
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 = ApimaticcalculatorlatestClient(jwt)
Class Reference
List of Controllers
- ProductController
- LOSPricingController
- MessagingController
- PropertyManagersController
- RequestToBookController
- ImagesController
- FeeAndTaxMandatoryAtThePropertyLevelController
- YieldsController
- FeeAndTaxController
- ValidationController
- PushNotificationController
- RatesAndAvailabilityController
- ReservationNotificationsController
- TestingOfMessageAPICallsController
- AuthorizationController
ProductController
Get controller instance
An instance of the ProductController
class can be accessed from the API Client.
product_controller = client.product
updateproduct
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 updateproduct(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreateUpdatePropertyRequest()
result = product_controller.updateproduct(content_type, body)
createproduct
This function allows a logged in user to create new product. You can only send one product in each request.
def createproduct(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreateUpdatePropertyRequest()
result = product_controller.createproduct(content_type, body)
deletelistproduct
This function allows logged in user to delete list of products.
def deletelistproduct(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = PropertyListRequest()
result = product_controller.deletelistproduct(content_type, body)
create_activationlistproduct
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_activationlistproduct(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = PropertyListRequest()
result = product_controller.create_activationlistproduct(content_type, body)
deleteproduct
This function allows the logged in user to delete product.
def deleteproduct(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
Property ID |
Example Usage
product_id = 'productId'
result = product_controller.deleteproduct(product_id)
getproductlist
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 getproductlist(self)
Example Usage
result = product_controller.getproductlist()
create_deactivationlistproduct
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_deactivationlistproduct(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = PropertyListRequest()
result = product_controller.create_deactivationlistproduct(content_type, body)
getproductby_id
This function allows logged in user to get a specific product.
def getproductby_id(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
Id of the property |
Example Usage
product_id = 'productId'
result = product_controller.getproductby_id(product_id)
LOSPricingController
Get controller instance
An instance of the LOSPricingController
class can be accessed from the API Client.
los_pricing_controller = client.los_pricing
createandupdate_los_lengthof_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 createandupdate_los_lengthof_stay_pricing(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreateandupdateLOSRequest()
result = los_pricing_controller.createandupdate_los_lengthof_stay_pricing(content_type, body)
getlospriceslistbyproduct_id
This function allows the logged in user to get a LOS rate for property.
def getlospriceslistbyproduct_id(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
Property ID in BookingPal |
Example Usage
product_id = 'productId'
result = los_pricing_controller.getlospriceslistbyproduct_id(product_id)
MessagingController
Get controller instance
An instance of the MessagingController
class can be accessed from the API Client.
messaging_controller = client.messaging
getmessagethreads
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 getmessagethreads(self,
page,
limit,
thread_type)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Required |
Number of current page |
limit | Required |
Limit of how many threads will be showed at one page |
threadType | Required |
Request all threads or only threads with unanswered message {new,all} |
Example Usage
page = 73
limit = 73
thread_type = 'threadType'
result = messaging_controller.getmessagethreads(page, limit, thread_type)
postnewmessageforspecificthread
This function will allow PM to post new messages in already existing threads.
def postnewmessageforspecificthread(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = PostnewmessageforspecificthreadRequest()
result = messaging_controller.postnewmessageforspecificthread(content_type, body)
getmessagelistforspecificthread
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 getmessagelistforspecificthread(self,
thread_id)
Parameters
Parameter | Tags | Description |
---|---|---|
threadId | Required |
ID of the thread |
Example Usage
thread_id = 'threadId'
result = messaging_controller.getmessagelistforspecificthread(thread_id)
PropertyManagersController
Get controller instance
An instance of the PropertyManagersController
class can be accessed from the API Client.
property_managers_controller = client.property_managers
get_p_mslist
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_p_mslist(self)
Example Usage
result = property_managers_controller.get_p_mslist()
update_property_managerdetails
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_managerdetails(self,
content_type,
body,
id)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
id | Required |
Property Manager ID |
Example Usage
content_type = 'Content-Type'
body = CreatenewUpdatePropertyManagerRequest()
id = 'id'
result = property_managers_controller.update_property_managerdetails(content_type, body, id)
createnew_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 createnew_property_manager(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreatenewUpdatePropertyManagerRequest()
result = property_managers_controller.createnew_property_manager(content_type, body)
get_property_managerdetaildata
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_managerdetaildata(self,
content_type,
id)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
id | Required |
Property Manager ID |
Example Usage
content_type = 'Content-Type'
id = 'id'
result = property_managers_controller.get_property_managerdetaildata(content_type, id)
RequestToBookController
Get controller instance
An instance of the RequestToBookController
class can be accessed from the API Client.
request_to_book_controller = client.request_to_book
create_requestto_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_requestto_book_test(self,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
body | Required |
TODO: Add a parameter description |
Example Usage
body = RequesttoBookTestRequest()
result = request_to_book_controller.create_requestto_book_test(body)
create_requestto_book_answerfrom_pms
This is an API call which you should use for accepting on avoiding requests to book.
def create_requestto_book_answerfrom_pms(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = RequesttoBookAnswerfromPMSRequest()
result = request_to_book_controller.create_requestto_book_answerfrom_pms(content_type, body)
create_requestto_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_requestto_book_request(self,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
body | Required |
TODO: Add a parameter description |
Example Usage
body = RequestToBookRequestModel()
result = request_to_book_controller.create_requestto_book_request(body)
ImagesController
Get controller instance
An instance of the ImagesController
class can be accessed from the API Client.
images_controller = client.images
createimages
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 createimages(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreateimagesRequest()
result = images_controller.createimages(content_type, body)
getimagelistbyproduct_id
This function allows logged in user to get image list for the existing product
def getimagelistbyproduct_id(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
ID of the property |
Example Usage
product_id = 'productId'
result = images_controller.getimagelistbyproduct_id(product_id)
deleteallimagesperproperty
This function allows logged in user to delete images.
def deleteallimagesperproperty(self,
content_type,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
productId | Required |
ID of property for which you want to delete all images |
Example Usage
content_type = 'Content-Type'
product_id = 'productId'
result = images_controller.deleteallimagesperproperty(content_type, product_id)
deletelistofimages
This function allows the logged in user to delete image(s) from the existing product.
def deletelistofimages(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = DeletelistofimagesRequest()
result = images_controller.deletelistofimages(content_type, body)
FeeAndTaxMandatoryAtThePropertyLevelController
Get controller instance
An instance of the FeeAndTaxMandatoryAtThePropertyLevelController
class can be accessed from the API Client.
fee_and_tax_mandatory_at_the_property_level_controller = client.fee_and_tax_mandatory_at_the_property_level
getfeeandtaxmandatory
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 getfeeandtaxmandatory(self)
Example Usage
result = fee_and_tax_mandatory_at_the_property_level_controller.getfeeandtaxmandatory()
create_importorupdatefeeandtaxmandatory
This function allows the logged in user to import or update a fee and tax mandatory.
def create_importorupdatefeeandtaxmandatory(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = SetfeeandtaxvalidationsettingRequest()
result = fee_and_tax_mandatory_at_the_property_level_controller.create_importorupdatefeeandtaxmandatory(content_type, body)
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(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = PropertyListRequest()
result = fee_and_tax_mandatory_at_the_property_level_controller.create_remove_validation_settings(content_type, body)
YieldsController
Get controller instance
An instance of the YieldsController
class can be accessed from the API Client.
yields_controller = client.yields
get_ym_rlistbyproduct_id
This function allows the logged in user to get yield management rules list of the specific product.
def get_ym_rlistbyproduct_id(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
ID of the property |
Example Usage
product_id = 'productId'
result = yields_controller.get_ym_rlistbyproduct_id(product_id)
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: {basic price per night} = price per night
- If YMR is set it can Increase/decrease percent or increase/decrease amount: {basic price per night} + {yield amount} = {price per night} or {basic price per night} - {yield amount} = {price 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(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreateYieldRequest()
result = yields_controller.create_ymr(content_type, body)
FeeAndTaxController
Get controller instance
An instance of the FeeAndTaxController
class can be accessed from the API Client.
fee_and_tax_controller = client.fee_and_tax
getfeeandtaxlistbyproduct_id
This function allows the logged in user to get a fee list for the specific product.
def getfeeandtaxlistbyproduct_id(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
ID of the property |
Example Usage
product_id = 'productId'
result = fee_and_tax_controller.getfeeandtaxlistbyproduct_id(product_id)
createfeeandtax
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 createfeeandtax(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreatefeeandtaxRequest()
result = fee_and_tax_controller.createfeeandtax(content_type, body)
ValidationController
Get controller instance
An instance of the ValidationController
class can be accessed from the API Client.
validation_controller = client.validation
get_booking_pal_validationjob_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_validationjob_full_pm(self)
Example Usage
result = validation_controller.get_booking_pal_validationjob_full_pm()
create_booking_pal_validationjob_listofproperties
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_validationjob_listofproperties(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = ValidationforListofpropertiesRequest()
result = validation_controller.create_booking_pal_validationjob_listofproperties(content_type, body)
PushNotificationController
Get controller instance
An instance of the PushNotificationController
class can be accessed from the API Client.
push_notification_controller = client.push_notification
get_notification_links
This will return all notification URLs which are set. It will work on PMS level, so use PMS credentials.
def get_notification_links(self)
Example Usage
result = push_notification_controller.get_notification_links()
create_push_notification_links
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(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = PushNotificationLinksRequest()
result = push_notification_controller.create_push_notification_links(content_type, body)
RatesAndAvailabilityController
Get controller instance
An instance of the RatesAndAvailabilityController
class can be accessed from the API Client.
rates_and_availability_controller = client.rates_and_availability
getratesandavailabilityproduct_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 getratesandavailabilityproduct_id(self,
content_type,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
productId | Required |
ID of the property |
Example Usage
content_type = 'Content-Type'
product_id = 'productId'
result = rates_and_availability_controller.getratesandavailabilityproduct_id(content_type, product_id)
createandupdateratesandavailability
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 createandupdateratesandavailability(self,
content_type,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
contentType | Required |
TODO: Add a parameter description |
body | Required |
TODO: Add a parameter description |
Example Usage
content_type = 'Content-Type'
body = CreateandupdateratesandavailabilityRequest()
result = rates_and_availability_controller.createandupdateratesandavailability(content_type, body)
ReservationNotificationsController
Get controller instance
An instance of the ReservationNotificationsController
class can be accessed from the API Client.
reservation_notifications_controller = client.reservation_notifications
get_reservationby_product
This function allows logged-in users to get all reservations for the specific product.
def get_reservationby_product(self,
product_id)
Parameters
Parameter | Tags | Description |
---|---|---|
productId | Required |
Product ID |
Example Usage
product_id = 'productId'
result = reservation_notifications_controller.get_reservationby_product(product_id)
get_reservationby_pm
This API call will return a list of reservations that belong to the current user.
def get_reservationby_pm(self)
Example Usage
result = reservation_notifications_controller.get_reservationby_pm()
TestingOfMessageAPICallsController
Get controller instance
An instance of the TestingOfMessageAPICallsController
class can be accessed from the API Client.
testing_of_message_api_calls_controller = client.testing_of_message_api_calls
get_testmessagelistforspecificthread
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_testmessagelistforspecificthread(self,
thread_id)
Parameters
Parameter | Tags | Description |
---|---|---|
threadId | Required |
ID of thread |
Example Usage
thread_id = 'threadId'
result = testing_of_message_api_calls_controller.get_testmessagelistforspecificthread(thread_id)
get_testmessagethreads
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_testmessagethreads(self,
page,
limit,
thread_type)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Required |
TODO: Add a parameter description |
limit | Required |
TODO: Add a parameter description |
threadType | Required |
Request all threads or only threads with unanswered message {new,all} |
Example Usage
page = 237
limit = 237
thread_type = 'threadType'
result = testing_of_message_api_calls_controller.get_testmessagethreads(page, limit, thread_type)
postnew_testmessageforspecificthread
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 postnew_testmessageforspecificthread(self,
body)
Parameters
Parameter | Tags | Description |
---|---|---|
body | Required |
TODO: Add a parameter description |
Example Usage
body = PostnewmessageforspecificthreadRequest()
result = testing_of_message_api_calls_controller.postnew_testmessageforspecificthread(body)
AuthorizationController
Get controller instance
An instance of the AuthorizationController
class can be accessed from the API Client.
authorization_controller = client.authorization
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 get_login(self,
username,
password)
Parameters
Parameter | Tags | Description |
---|---|---|
username | Required |
Your account email address (for PMS or PM) |
password | Required |
Your password |
Example Usage
username = 'username'
password = 'password'
result = authorization_controller.get_login(username, password)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file apimaticcalculatorlatest-4.0.0.tar.gz
.
File metadata
- Download URL: apimaticcalculatorlatest-4.0.0.tar.gz
- Upload date:
- Size: 94.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 399f45cdd3689f5f9ee0e4a744f188902acf93f1143bccf2fdcc0ad29f37bd09 |
|
MD5 | 5e5adda34d4e4d0919cc404125ca9029 |
|
BLAKE2b-256 | 4be8b65ce72b37a7b99247d48e19dd088832a45230f810dcc853b9efca14896e |
Provenance
File details
Details for the file apimaticcalculatorlatest-4.0.0-py3-none-any.whl
.
File metadata
- Download URL: apimaticcalculatorlatest-4.0.0-py3-none-any.whl
- Upload date:
- Size: 189.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43f4d977278875a624eb065de0ff31b0bb2126d8a4b03be7a4cb1b49f7c55ea6 |
|
MD5 | 2dfd07a7c926f7bfd7ea10ff95c38498 |
|
BLAKE2b-256 | bc802f30ea393a7c6ad3551cc69541eebd8a121dc301bddc9f2ad0e0df255570 |