Alexandre Hausherr's Blog

Alexandre Hausherr's Blog

Set custom variables in Smoobu bookings

Smoobu's API allows third-party systems to insert custom variables in bookings and apartments (currently in beta) , even-though it is not clear since they call these variables "custom placeholders", because these variables can be set as placeholders in messages templates.

How to

To insert a variable in a booking, create it with :

curl -X POST \
  https://login.smoobu.com/api/custom-placeholders \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
      "key": "myvar",
      "defaultValue": "my value",
      "type": 1,
      "foreignId": 185
}'

As they write in the documentation, "type" can be 1 for a booking, or 2 for an apartment. The "foreignId" is the id of the booking or the apartment, depending on the chosen "type".

You can now use the placeholder [myvar] in email templates. If a message with this placeholder is sent to the customer of the booking 185, the placeholder will be replaced by my value .

You can also set a variable on an apartment by setting type to 2 and foreignId with the id of the apartment. The value of the placeholder in messages will then depend on the apartment selected for a booking.

Custom placeholders can be updated or deleted afterwards.

 
Share this