This tool is oriented towards web developers and requires some basic knowledge of how a web service works. If you have arrived here researching how you can synchronize an external service (such as a real estate portal) you are in the right place. I recommend you to read this text carefully and direct your questions to: [email protected]
A. What are Webhooks?
They are a tool that you can use to receive, in a URL of your choice, all the information about a property every time it changes.
B. How is the information sent?
The information will be sent in a POST request in JSON format to a URL of your choice that you can configure in Witei > Settings > Webhooks.
Important note: we have a timeout of 15 seconds on these requests. If your service does not respond within 15 seconds to any request, we will retry 2 more times and if the problem still persists in your service, the webhook will be automatically deactivated, and consequently, the link will be removed in the Webhook section of Witei.
C. How do I receive the information?
You will have to configure your service to listen for POST requests on the URL you entered in Witei. Every time you create or modify a property in Witei, we will send a signal (POST request) to the URL you specified with all the information of the property.
Example of property JSON
{
"id":43191,
"identifier":"282",
"town":"desconocido",
"province":"desconocido",
"zone":null,
"district":null,
"urbanization":"",
"street":"Zurgena",
"street_number":"",
"geo_lat":0.0,
"geo_lng":0.0,
"renting":true,
"selling":false,
"renting_cost":400,
"renting_period":"monthly",
"selling_cost":0,
"kind":"flat",
"floor":null,
"bedrooms":0,
"bathrooms":0,
"area":1,
"pictures":[
"https://witei-media.s3.amazonaws.com/pics/104418-93120cf9.JPG"
],
"description":"Bonita villa con espectaculares vistas y con 700 m2 de parcela.\\n\\n3 dormitorios, 2 ba\\u00f1os, gran cocina con lavadero. Terraza grande y porche. Garage de 100 m2. Piscina. Zona tranquila.",
"agency":{
"name":"Tu inmobiliaria",
"address":"Street type Street Name, Street number, Zip code, Town, Province, Country",
"town":"Madrid",
"zip_code":"28001",
"phone_number_1":"612345678",
"phone_number_2":"987654321-2",
"logo":"http://dev-witei.comhttps://witei-dev-media.s3.amazonaws.com/pics/glogo_iVqY4IE.gif",
"currency":"EUR",
"currency_symbol":"\\u20ac"
},
"status":"available",
"is_reserved":false,
"zip_code":"00000",
"show_cost":true,
"floor_display":null,
"area_util":null,
"area_plot":null,
"area_terrace":null,
"energy_certificate_display":"In progress",
"updated":"2018-02-27T07:50:00.209498Z",
"kind_value":"flat",
"renting_period_display":"month",
"tags":[
"garaje",
"piscina comunitaria",
"terraza"
],
"virtual_visit":null,
"description_es":"Descripción en castellano.",
"description_en":"Descripción en inglés.",
"description_ca":"Descripción en catalán.",
"description_fr":"Descripción en francés.",
"description_ru":"Descripción en ruso.",
"description_nl":"Descripción en holandés.",
"description_nb":"Descripción en noruego.",
"description_fi":"Descripción en finés.",
"description_de":"Descripción en alemán.",
"description_sv":"Descripción en sueco.",
"is_exclusive":false,
"year_built":null,
"title":null,
"contact":{
"phone":"612345678",
"name":"Tu inmobiliaria",
"email":"[email protected]"
}
}
There are two possibilities of response from the server or "End Point" to these requests:
If the URL you have added in Witei is incorrect, this request fails and therefore the server or "End Point" returns a response with a 40X or 50X error code. Consequently, Witei disables the Webhook and notifies the user by email notification.
In this case, the user must check what happens to the URL he/she added in Witei to create a new Webhook with a correct URL. If the URL you have added in Witei is correct, this request will work correctly and therefore the server or "End Point" will return a 20X code response.
Important note: Witei accumulates in 5 minute time windows all Webhooks requests. This means that if you make a change in a property (e.g. add a photo) it can take between minimum 0 and maximum 5 minutes before Witei sends the request to the URL indicated by the user who made the request in the Webhook configuration.
There may be occasional cases in which the time is delayed beyond 5 minutes (because there are many Webhooks queued to make requests) or even a Webhook is lost. These are marginal cases <0.01% of the cases and are still reviewed by the team for errors.
D. How can I test the webhooks?
In order for you to do your first tests, we recommend this external service:
It is a free service where you can generate a temporary URL that will "listen" for requests from remote systems. Copy that URL and paste it into your Witei configuration. Modify a property and in a matter of seconds you will be able to see how a message arrives from Witei.
If you have any questions, ask us through the chat!