Package: apimaticcalculatorlatest
Getting startedBefore beginning work it is necessary that:Your organization is registered and activatedYou have participated in a kick­off meetingThe opening questionnaire has been filled outYou have your login and password. (Using it you get a unique sessiontokenthat must be used in every request to API as paramjwt)Contact usto 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 arecase sensitivein 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 successful200status and an empty response body.How to BuildYou must have Python2 >=2.7.9or Python3 >=3.4installed 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 therequirements.txtfile that comes with the SDK.
To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps athttps://pip.pypa.io/en/stable/installing/.Python and PIP executables should be defined in your PATH. Open command prompt and typepip --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 (includingrequirements.txt) for the SDK.Run the commandpip install -r requirements.txt. This should install all the required dependencies.How to UseThe following section explains how to use the Apimaticcalculatorlatest SDK package in a new project.1. Open Project in an IDEOpen up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.Click onOpenin PyCharm to browse to your generated SDK directory and then clickOK.The project files will be displayed in the side bar as follows:2. Add a new Test ProjectCreate 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 linesfromapimaticcalculatorlatest.apimaticcalculatorlatest_clientimportApimaticcalculatorlatestClientAfter 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 ProjectTo run the file within your test project, right click on your Python file inside your Test project and click onRunHow to TestYou 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.Invokepip install -r test-requirements.txtInvokenosetestsInitializationAuthenticationIn order to setup authentication and initialization of the API client, you need the following information.ParameterDescriptionjwtToken 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 credentialsjwt='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 ReferenceList of ControllersProductControllerLOSPricingControllerMessagingControllerPropertyManagersControllerRequestToBookControllerImagesControllerFeeAndTaxMandatoryAtThePropertyLevelControllerYieldsControllerFeeAndTaxControllerValidationControllerPushNotificationControllerRatesAndAvailabilityControllerReservationNotificationsControllerTestingOfMessageAPICallsControllerAuthorizationControllerProductControllerGet controller instanceAn instance of theProductControllerclass can be accessed from the API Client.product_controller=client.productupdateproductThis 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.defupdateproduct(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreateUpdatePropertyRequest()result=product_controller.updateproduct(content_type,body)createproductThis function allows a logged in user to create new product. You can only send one product in each request.defcreateproduct(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreateUpdatePropertyRequest()result=product_controller.createproduct(content_type,body)deletelistproductThis function allows logged in user to delete list of products.defdeletelistproduct(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=PropertyListRequest()result=product_controller.deletelistproduct(content_type,body)create_activationlistproductThis 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.defcreate_activationlistproduct(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=PropertyListRequest()result=product_controller.create_activationlistproduct(content_type,body)deleteproductThis function allows the logged in user to delete product.defdeleteproduct(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredProperty IDExample Usageproduct_id='productId'result=product_controller.deleteproduct(product_id)getproductlistThis 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.defgetproductlist(self)Example Usageresult=product_controller.getproductlist()create_deactivationlistproductThis 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.defcreate_deactivationlistproduct(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=PropertyListRequest()result=product_controller.create_deactivationlistproduct(content_type,body)getproductby_idThis function allows logged in user to get a specific product.defgetproductby_id(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredId of the propertyExample Usageproduct_id='productId'result=product_controller.getproductby_id(product_id)Back to List of ControllersLOSPricingControllerGet controller instanceAn instance of theLOSPricingControllerclass can be accessed from the API Client.los_pricing_controller=client.los_pricingcreateandupdate_los_lengthof_stay_pricingIntroduction: 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.defcreateandupdate_los_lengthof_stay_pricing(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreateandupdateLOSRequest()result=los_pricing_controller.createandupdate_los_lengthof_stay_pricing(content_type,body)getlospriceslistbyproduct_idThis function allows the logged in user to get a LOS rate for property.defgetlospriceslistbyproduct_id(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredProperty ID in BookingPalExample Usageproduct_id='productId'result=los_pricing_controller.getlospriceslistbyproduct_id(product_id)Back to List of ControllersMessagingControllerGet controller instanceAn instance of theMessagingControllerclass can be accessed from the API Client.messaging_controller=client.messaginggetmessagethreadsThis 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.defgetmessagethreads(self,page,limit,thread_type)ParametersParameterTagsDescriptionpageRequiredNumber of current pagelimitRequiredLimit of how many threads will be showed at one pagethreadTypeRequiredRequest all threads or only threads with  unanswered message {new,all}Example Usagepage=73limit=73thread_type='threadType'result=messaging_controller.getmessagethreads(page,limit,thread_type)postnewmessageforspecificthreadThis function will allow PM to post new messages in already existing threads.defpostnewmessageforspecificthread(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=PostnewmessageforspecificthreadRequest()result=messaging_controller.postnewmessageforspecificthread(content_type,body)getmessagelistforspecificthreadThis function allows the logged in user to get a list of all messages from passed thread Id. You need to use PM credentials.defgetmessagelistforspecificthread(self,thread_id)ParametersParameterTagsDescriptionthreadIdRequiredID of the threadExample Usagethread_id='threadId'result=messaging_controller.getmessagelistforspecificthread(thread_id)Back to List of ControllersPropertyManagersControllerGet controller instanceAn instance of thePropertyManagersControllerclass can be accessed from the API Client.property_managers_controller=client.property_managersget_p_mslistThis 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.defget_p_mslist(self)Example Usageresult=property_managers_controller.get_p_mslist()update_property_managerdetailsThis 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.defupdate_property_managerdetails(self,content_type,body,id)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionidRequiredProperty Manager IDExample Usagecontent_type='Content-Type'body=CreatenewUpdatePropertyManagerRequest()id='id'result=property_managers_controller.update_property_managerdetails(content_type,body,id)createnew_property_managerThis 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.defcreatenew_property_manager(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreatenewUpdatePropertyManagerRequest()result=property_managers_controller.createnew_property_manager(content_type,body)get_property_managerdetaildataThis 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 mandatoryin Policies Model - you can pass any field,  and none of them is mandatoryif you do use PaymentPolicy - all fields inside are mandatoryif you do use CancellationPolicy - all fields inside are mandatoryif you use Payment Model - all fields inside are mandatorydefget_property_managerdetaildata(self,content_type,id)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionidRequiredProperty Manager IDExample Usagecontent_type='Content-Type'id='id'result=property_managers_controller.get_property_managerdetaildata(content_type,id)Back to List of ControllersRequestToBookControllerGet controller instanceAn instance of theRequestToBookControllerclass can be accessed from the API Client.request_to_book_controller=client.request_to_bookcreate_requestto_book_testSince 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.defcreate_requestto_book_test(self,body)ParametersParameterTagsDescriptionbodyRequiredTODO: Add a parameter descriptionExample Usagebody=RequesttoBookTestRequest()result=request_to_book_controller.create_requestto_book_test(body)create_requestto_book_answerfrom_pmsThis is an API call which you should use for accepting on avoiding requests to book.defcreate_requestto_book_answerfrom_pms(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=RequesttoBookAnswerfromPMSRequest()result=request_to_book_controller.create_requestto_book_answerfrom_pms(content_type,body)create_requestto_book_requestTags:Skips AuthenticationThis 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.defcreate_requestto_book_request(self,body)ParametersParameterTagsDescriptionbodyRequiredTODO: Add a parameter descriptionExample Usagebody=RequestToBookRequestModel()result=request_to_book_controller.create_requestto_book_request(body)Back to List of ControllersImagesControllerGet controller instanceAn instance of theImagesControllerclass can be accessed from the API Client.images_controller=client.imagescreateimagesThis 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)defcreateimages(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreateimagesRequest()result=images_controller.createimages(content_type,body)getimagelistbyproduct_idThis function allows logged in user to get image list for the existing productdefgetimagelistbyproduct_id(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredID of the propertyExample Usageproduct_id='productId'result=images_controller.getimagelistbyproduct_id(product_id)deleteallimagesperpropertyThis function allows logged in user to delete images.defdeleteallimagesperproperty(self,content_type,product_id)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionproductIdRequiredID of property for which you want to delete all imagesExample Usagecontent_type='Content-Type'product_id='productId'result=images_controller.deleteallimagesperproperty(content_type,product_id)deletelistofimagesThis function allows the logged in user to delete image(s) from the existing product.defdeletelistofimages(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=DeletelistofimagesRequest()result=images_controller.deletelistofimages(content_type,body)Back to List of ControllersFeeAndTaxMandatoryAtThePropertyLevelControllerGet controller instanceAn instance of theFeeAndTaxMandatoryAtThePropertyLevelControllerclass can be accessed from the API Client.fee_and_tax_mandatory_at_the_property_level_controller=client.fee_and_tax_mandatory_at_the_property_levelgetfeeandtaxmandatoryThis 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.defgetfeeandtaxmandatory(self)Example Usageresult=fee_and_tax_mandatory_at_the_property_level_controller.getfeeandtaxmandatory()create_importorupdatefeeandtaxmandatoryThis function allows the logged in user to import or update a fee and tax mandatory.defcreate_importorupdatefeeandtaxmandatory(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=SetfeeandtaxvalidationsettingRequest()result=fee_and_tax_mandatory_at_the_property_level_controller.create_importorupdatefeeandtaxmandatory(content_type,body)create_remove_validation_settingsThis 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.defcreate_remove_validation_settings(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=PropertyListRequest()result=fee_and_tax_mandatory_at_the_property_level_controller.create_remove_validation_settings(content_type,body)Back to List of ControllersYieldsControllerGet controller instanceAn instance of theYieldsControllerclass can be accessed from the API Client.yields_controller=client.yieldsget_ym_rlistbyproduct_idThis function allows the logged in user to get yield management rules list of the specific product.defget_ym_rlistbyproduct_id(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredID of the propertyExample Usageproduct_id='productId'result=yields_controller.get_ym_rlistbyproduct_id(product_id)create_ymrThis 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 nightIf 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.defcreate_ymr(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreateYieldRequest()result=yields_controller.create_ymr(content_type,body)Back to List of ControllersFeeAndTaxControllerGet controller instanceAn instance of theFeeAndTaxControllerclass can be accessed from the API Client.fee_and_tax_controller=client.fee_and_taxgetfeeandtaxlistbyproduct_idThis function allows the logged in user to get a fee list for the specific product.defgetfeeandtaxlistbyproduct_id(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredID of the propertyExample Usageproduct_id='productId'result=fee_and_tax_controller.getfeeandtaxlistbyproduct_id(product_id)createfeeandtaxThis 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.defcreatefeeandtax(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreatefeeandtaxRequest()result=fee_and_tax_controller.createfeeandtax(content_type,body)Back to List of ControllersValidationControllerGet controller instanceAn instance of theValidationControllerclass can be accessed from the API Client.validation_controller=client.validationget_booking_pal_validationjob_full_pmThis 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.defget_booking_pal_validationjob_full_pm(self)Example Usageresult=validation_controller.get_booking_pal_validationjob_full_pm()create_booking_pal_validationjob_listofpropertiesThis 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.defcreate_booking_pal_validationjob_listofproperties(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=ValidationforListofpropertiesRequest()result=validation_controller.create_booking_pal_validationjob_listofproperties(content_type,body)Back to List of ControllersPushNotificationControllerGet controller instanceAn instance of thePushNotificationControllerclass can be accessed from the API Client.push_notification_controller=client.push_notificationget_notification_linksThis will return all notification URLs which are set. It will work on PMS level, so use PMS credentials.defget_notification_links(self)Example Usageresult=push_notification_controller.get_notification_links()create_push_notification_linksProvide 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.defcreate_push_notification_links(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=PushNotificationLinksRequest()result=push_notification_controller.create_push_notification_links(content_type,body)Back to List of ControllersRatesAndAvailabilityControllerGet controller instanceAn instance of theRatesAndAvailabilityControllerclass can be accessed from the API Client.rates_and_availability_controller=client.rates_and_availabilitygetratesandavailabilityproduct_idThis 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.defgetratesandavailabilityproduct_id(self,content_type,product_id)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionproductIdRequiredID of the propertyExample Usagecontent_type='Content-Type'product_id='productId'result=rates_and_availability_controller.getratesandavailabilityproduct_id(content_type,product_id)createandupdateratesandavailabilityCreate 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.defcreateandupdateratesandavailability(self,content_type,body)ParametersParameterTagsDescriptioncontentTypeRequiredTODO: Add a parameter descriptionbodyRequiredTODO: Add a parameter descriptionExample Usagecontent_type='Content-Type'body=CreateandupdateratesandavailabilityRequest()result=rates_and_availability_controller.createandupdateratesandavailability(content_type,body)Back to List of ControllersReservationNotificationsControllerGet controller instanceAn instance of theReservationNotificationsControllerclass can be accessed from the API Client.reservation_notifications_controller=client.reservation_notificationsget_reservationby_productThis function allows logged-in users to get all reservations for the specific product.defget_reservationby_product(self,product_id)ParametersParameterTagsDescriptionproductIdRequiredProduct IDExample Usageproduct_id='productId'result=reservation_notifications_controller.get_reservationby_product(product_id)get_reservationby_pmThis API call will return a list of reservations that belong to the current user.defget_reservationby_pm(self)Example Usageresult=reservation_notifications_controller.get_reservationby_pm()Back to List of ControllersTestingOfMessageAPICallsControllerGet controller instanceAn instance of theTestingOfMessageAPICallsControllerclass can be accessed from the API Client.testing_of_message_api_calls_controller=client.testing_of_message_api_callsget_testmessagelistforspecificthreadSince 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 credentialsNote: 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.defget_testmessagelistforspecificthread(self,thread_id)ParametersParameterTagsDescriptionthreadIdRequiredID of threadExample Usagethread_id='threadId'result=testing_of_message_api_calls_controller.get_testmessagelistforspecificthread(thread_id)get_testmessagethreadsThis 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.defget_testmessagethreads(self,page,limit,thread_type)ParametersParameterTagsDescriptionpageRequiredTODO: Add a parameter descriptionlimitRequiredTODO: Add a parameter descriptionthreadTypeRequiredRequest all threads or only threads with unanswered message {new,all}Example Usagepage=237limit=237thread_type='threadType'result=testing_of_message_api_calls_controller.get_testmessagethreads(page,limit,thread_type)postnew_testmessageforspecificthreadThis 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.defpostnew_testmessageforspecificthread(self,body)ParametersParameterTagsDescriptionbodyRequiredTODO: Add a parameter descriptionExample Usagebody=PostnewmessageforspecificthreadRequest()result=testing_of_message_api_calls_controller.postnew_testmessageforspecificthread(body)Back to List of ControllersAuthorizationControllerGet controller instanceAn instance of theAuthorizationControllerclass can be accessed from the API Client.authorization_controller=client.authorizationget_loginTags:Skips AuthenticationIn 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.defget_login(self,username,password)ParametersParameterTagsDescriptionusernameRequiredYour account email address (for PMS or PM)passwordRequiredYour passwordExample Usageusername='username'password='password'result=authorization_controller.get_login(username,password)Back to List of Controllers