We would like you to be up to date about bookings or enquiries of all your connected properties. This is why we are able to push a notification to a predefined URL of yours. You will then be able to fetch all relevant information using our bookings or enquiries service.
Before you are going to develop, please follow the next steps:
The structure of the URL and the used parameters might look as follows:
| Booking type | Example structure of the URL |
|---|---|
| Instant Booking | https://propertymanagementsystem.com/push?event=new&booking_id=123456&object_id=987654 |
| Enquiry | https://propertymanagementsystem.com/push?event=new&enquiry_id=123456&object_id=987654 |
We append these parameters to the URL automatically. Parameters that are included in the URL you provided us with will be kept, unless they have the same name as one of our parameters, in which case their value will be overwritten.
| Event | Property mode | Parameters | Description |
|---|---|---|---|
| Booking | Instantly bookable | ?event=new&booking_id=123456&object_id=987654 | Sent when a binding booking has been made. |
| Modification | Instantly bookable | ?event=update&booking_id=123456&object_id=987654 | Sent when booking information has been changed. You can retrieve the new booking information using the bookings service. Please note that you have to identify the diff at your end or simply overwrite information. |
| Closure | Instantly bookable | ?event=done&booking_id=123456&object_id=987654 | Sent when payment for the booking has been received and booking has been closed |
| Cancellation | Instantly bookable | ?event=cancel&booking_id=123456&object_id=987654 | Sent when a booking has been cancelled |
| Inquiry | Inquiry mode | ?event=new&enquiry_id=223344&object_id=555444 | Sent when a new inquiry has been made. This is the only event for properties in inquiry mode |
The Push service notification scheme for the push service provides you with a sound idea of how the notifications are being structured.
The example represents a notification for a new booking that has been made. In case this booking will be changed, closed or cancelled, a new notification will be generated, where the body content will be different for event.type and the stamps.
Included in the example is a token key granting access to the all the bookings of the entire property. If you use an API key, the token section will be omitted. The key can be used by sending it as an “X-Token” HTTP-Header in your requests to the bookings or enquiries services.
POST /push?event=new&booking_id=6563&object_id=1001539 HTTP/1.1 Host: propertymanagementsystem.com User-Agent: connect.travanto.de Accept: */* Referer: https://connect.travanto.de/service/push/ Content-Type: application/json; charset=utf-8 Content-Length: 494
To: your_email@domain.tld Subject: Travanto Push Notification From: noreply@travanto.de MIME-Version: 1.0 Content-type: text/json; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20170314124801.ABC123D4@vermieter.travanto.de> Date: Tue, 14 Mar 2017 13:48:01 +0100 (CET)
{
"notification": {
"stamp": "2017-03-14T13:48:01+01:00",
"event": {
"type": "new",
"stamp": "2017-03-14T13:37:34+01:00"
},
"entity": {
"type": "booking",
"id": 6563,
"url": "https:\/\/connect.travanto.de\/service\/bookings\/6563\/",
"object_id": 1001539,
"user_id": 1000543
},
"mapping": {
"object_id": "your_ID_123456",
"user_id": "your_user_ID_987654"
},
"token": {
"access": "object",
"key": "M8hiM0EY0FKM5SMExv4Ey0weBOLe8v5e2BTF48okgB3FA6p46o"
},
"json_schema": "http:\/\/connect.travanto.de\/schemata\/push\/notification.json"
}
}