Airbnb

Last updated: October 30th, 2019

Introduction

In this tutorial will create the content for Airbnb and we'll push it through Octorate Connection

Required knowledge / points:
  • You MUST be already confident about how properties works in octorate, how creating them and handling them inside our APIs.
  • You MUST be already confident about how create connections inside octorate.
  • You MUST have read the start guide carrefully
  • The connection should be actived, it means the customer has completed the eventually required OAUTH flow inside octorate.
  • You should know how HTTP APIs works
  • It's suggested to be confident with tools like curl

Airbnb Connection

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

Let's make it work

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

Step One: Base Info

Example of a call Try it / See updated schema
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

Step Two: Descriptions

Example of a call Try it / See updated schema
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:

  • The mostly of descriptions are LanguageMap: maps where the key is the ISO code of the language and in the value the value to assign to that key
  • The only meaningful exception is the PortalCustomItem of LanguageMap, that's another map consisted of "Portal" and "LanguageMap"

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

Step 3: Other settings (Reservations, Availability, Pricing)

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 latests
The same applies for booking category: you can query the available metas to retrieve the last ones.

Step 4: Amenities

In order to push some amenities we need before to ask the system the available amenities

Example of a call Try it / See updated schema
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
Example of a call Try it / See updated schema
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.

Step 5: Subrooms

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

Example of a call Try it / See updated schema
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.

Step 6: Photos

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.

Step 7: Fees

In the same way done before, you can now push fees. Keep care of the relative available metas

Step 8: Push the content to Airbnb

Now that you've configured all the contents you're ready to push everything to Airbnb!

Example of a call Try it / See updated schema
curl -X POST "{endpoint}/rest/content/products/{accommodation}/{product}/push/AIRBNB -H "Authorization: Basic {base64 credentials}" -H "key: {yourkey}"