REST API Method: listings/fetch-unit-types
Fetches the unit types of a listing (types of guest rooms, guest units, or bed plans). Requires the parameters specified below. Request must be a POST.
URL
http://api.bookingmarkets.com/listings/fetch-unit-types?api_key=your_key
Formats:
- xml
- json
HTTP Method(s):
- POST
- GET (maximum of 2048 characters)
Requires Authentication:
true
API rate limited:
false
Parameters:
- listing token="XXX". Required. Identifies the listing for which the unit types are being fetched. Hosts can get the tokens for their listings by visiting the URL /tokens in any of the sites powered by the BookingMarkets Engine (for example: http://localo.com/tokens). For testing purposes you can use the token czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09.
Response
- ok. The request was successfully processed.
- timestamp. Timestamp of the transaction in UnixTime (GMT).
- namelatinchar. The name of the listing in latin characters.
- namenonlatinchar. The name of the listing in non-latin characters. Only available in listings from countries with official languages that use non-latin characters (for example: China). The value will be empty if there isn't a non-latin name.
- unittype id. Multiple occurrences possible. Identifies each one the types of units of the listing.
- namelatinchar. The name of the unit type in latin characters.
- namenonlatinchar. The name of the unit type in non-latin characters. Only available in listings from countries with official languages that use non-latin characters (for example: China). The value will be empty if there isn't a non-latin name.
- error. The request wasn't successfully processed.
- errorcode. Error code.
- errormessage. Error message explaining the issue.
Examples
Request (XML):
http://api.bookingmarkets.com/listings/fetch-unit-types?api_key=your_key&xml=
<request>
<listing token="czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09"></listing>
</request>
Successful Response:
<?xml version="1.0" encoding="UTF-8"?>
<ok>
<timestamp>1287186106</timestamp>
<namelatinchar>BookingMarkets APIs Test Listing</namelatinchar>
<namenonlatinchar></namenonlatinchar>
<unittype id=24944>
<namelatinchar>Space Shuttle Enterprise</namelatinchar>
<namenonlatinchar></namenonlatinchar>
</unittype>
<unittype id=24945>
<namelatinchar>Chang Zheng 2F</namelatinchar>
<namenonlatinchar>长征二号F火箭</namenonlatinchar>
</unittype>
<unittype id=24946>
<namelatinchar>Soyuz</namelatinchar>
<namenonlatinchar>Сою́з</namenonlatinchar>
</unittype>
</ok>
Failed Response:
<?xml version="1.0" encoding="UTF-8"?>
<error>
<errorcode>0200a</errorcode>
<errormessage>The listing token is not valid. Please find the correct token by visiting the URL /tokens in any of the sites powered by the BookingMarkets Engine</errormessage>
</error>
Sandbox
You can test your application using the following test listing:
- Public listing: BookingMarkets APIs Test Listing in LetMeGo.
- Listing token: czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09
- URL to view the subunits: http://sandboxlisting.letmego.com/
Have questions or need help? We are eager to help. Contact us!
0 Comments
Please sign in to post a comment.