Take care of schemas
Seeing our swagger documentation , when the API requires in body a JSON encoded text, near every json example, in the request body, you have a small tab voice called "Schema". Click it to see a description of each field
In this tutorial will create the content for Airbnb and we'll push it through Octorate Connection
Required knowledge / points:The informations for Airbnb is organized around products.
So you don't have to push accommodation content.
Since Airbnb for a listing has only one policy, and usually on Airbnb are listed only one listing by room type, normally only the standard rate with the lowest occupancy is linked to Airbnb, you can also verify with our mapping call if there are any rooms already configured/connected.
The expected result then is to have most of the values inside Room/Product/Listing Content configured, and pushing to Airbnb, having a 200 OK Status.
Just to help you remembering all the fields, here to follow, is given the UML rappresentation of the entities composing the JSON
Seeing our swagger documentation , when the API requires in body a JSON encoded text, near every json example, in the request body, you have a small tab voice called "Schema". Click it to see a description of each field
curl -X POST "{endpoint}/rest/content/products/{accommodation}/{product}/listing -H "Content-Type: application/json" -d {followingjson} -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}"
{
"bookingPropertyGroup": "Apartment",
"airbnbPropertyGroup": "apartments",
"airbnbPropertyType": "aparthotel",
"quantity": 2,
"internalName": "4pax room",
"bathrooms": 2,
"bedrooms": 2,
"beds": 3,
"place": {
"phone": "+393347608861",
"districtName": "Roma",
"city": "Roma",
"zipCode": "00055",
"latitude": 41.8475636,
"longitude": 12.5871812,
"zoom": 13,
"country": "IT",
"address": "Via bernandino Alimena"
},
"personCapacity": 5,
"bathroomShared": false,
"country": "IT",
"size": 400,
"airbnbRoomType": "private_room",
"airbnbEntireHome": true
}
Basically here we're telling Airbnb the type of the listing, were it is located, and whether the people inside will have to share someplace / something.
Please note that not all subcategory are compatible, you cannot for instance set as Property Group "Apartment" and then configure as property type something like an hotel room.
Internal name if not provided, is automatically provided using the room name
Remember also the our size of rooms is always in meters squared, so if you use feet you will have to convert this value in mq
Remember that the country and currency codes are the ISO codes
The expected result is 200 OK, any other status will rappresent an issue
curl -X POST "{endpoint}/rest/content/products/{accommodation}/{product}/descriptions -H "Content-Type: application/json" -d {followingjson} -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}"
{
"directions": "Follow the A12 motorway and exit to the first exist, our house is on the left side",
"headline": {
"fallback": {
"EN": "This is the LanguageMap value in English! It's used when a portal value is not available"
},
"values": {
"AIRBNB": {
"IT": "This is a value in italian!"
},
"HOMEAWAY": {
"ES": "This is a value in Spanish!"
},
"BOOKING": {
"EN": "This is a value for a LanguageMap in English!",
"IT": "This is a value in italian!"
}
}
},
"description": {
"EN": "This are the LanguageMap value in English!"
},
"houseRules": {
"EN": "You're not allowed to smoke inside bathrooms"
},
"spaceInformation": {
"EN": "Kitchen stoves are in the second shelf"
},
"access": {
"EN": "This are the LanguageMap value in English!"
},
"paymentNotes": {
"EN": "This are the LanguageMap value in English!"
},
"internalCustomName": "4"
}
The only things to take in considerations here are:
Please note that for Airbnb you should fill some descriptions in order to push the room
The headline (the title for customers) could be customized according to the portal
In the same way done before, you can now push the reservation, availability and pricing settings
{
"childrenAllowed": true,
"noChildrenReason": "I don't like children",
"smokersAllowed": false,
"petsAllowed": false,
"eventsAllowed": false,
"infantsAllowed": false,
"welcomeMessage": "My dear guest, I looking forward to have you in my home!",
"instantBookingCategory": "everyone",
"noticeHours": 2,
"airbnbCancellation": "flexible",
"mininumAge": 18,
"checkinTimeStart": 12,
"checkinTimeEnd": 15,
"checkoutTime": 10,
}
The currently allowed policies for Airbnb are flexible, moderate, super_strict_30,super_strict_60, but you can query our metas to retrieve the latestsIn order to push some amenities we need before to ask the system the available amenities
curl -X GET "{endpoint}/rest/content/products/mapping/amenities?portal=AIRBNB -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey} -H "Content-Type: application/json" -d {followingjson} "
Response like:
... Other amenities hidden ...
{
"id": 541,
"internalName": "FIRE_EXTINGUISHER",
"label": "Fire extinguisher",
"values": {
"AIRBNB": "fire_extinguisher"
}
... Other amenities hidden ...
Here the "internal name" "FIRE_EXTINGUISHER" will be what we can use to add the service to our product
Let's then add it to our product
curl -X POST "{endpoint}/rest/content/products/{accommodation}/{product}/amenities?amenity=FIRE_EXTINGUISHER&amenity=OTHER_AMENITY -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}"
We should now receive a feedack with response status 200.
The "Loft" (for instance) we're selling in Airbnb, could have many rooms inside, like the bathroom, the primary bedroom, the secondary bedroom and so on.. We can add these rooms the following way
curl -X POST "{endpoint}/rest/content/products/{accommodation}/{product}/rooms -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}" -H "Content-Type: application/json" -d {followingjson}
{
"type": "BEDROOM",
"privateBathroom": true,
"roomNumber": 0,
"beds": [
{
"quantity": 2,
"bedType": "KING",
}
],
"maxGuests": 2
}
The important staff where keep attention here is: bedType is restricted to the types of accepted ENUM. The type could also is restricted to accepted ENUMs. Keep care in the schema of what kind of metas are accepted.
Loading photos in Octorate have some restrictions.
First of all, a photo loaded inside the product will be loaded in the product also, so it will be visible also in the booking engine.
Keep attention: That's means that the photo MAY BE already existing (room already created) and that you MUST NOT push the photo again for another portal
Using the APIs, all the available photos will be marked as "sent". If the customers prefer to choose which kind of photo load, he will have to login inside Octorate and do it from the frontend.
As second point, The photo upload is asynchronus an restricted to a maximum size of 20MB.
That's mean that you will have to check after if the photo was loaded, using the id of the task, and save the assigned photo id in your system to avoid pushing again the same photo.
In the same way done before, you can now push fees. Keep care of the relative available metas
Now that you've configured all the contents you're ready to push everything to Airbnb!
curl -X POST "{endpoint}/rest/content/products/{accommodation}/{product}/push/AIRBNB -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}"