Client webhooks
All changes to clients trigger webhook requests. Here are examples of JSON payloads for every type of change.
As with requests, sets of fields for organizations and individuals differ. Payloads for organizations always have organization_name . Payloads for individuals have fist_name , last_name , and middle_name instead.
|
Client created
{
"event_type": "client_created",
"version": 1,
"context": {
"source": "web",
"happened_at": "2015-01-19T21:02:04.617Z",
"created_at": "2015-01-19T21:02:04.617Z",
"user_uuid": "8ebd12cc-b2d9-407c-a4f4-5943263d54a4",
"user_email": "jack@black",
"device_uuid": null
},
"client": {
"uuid": "07cf12b5-f2da-4a77-8065-11cac610ed84",
"external_id": "423430387320568-acme",
"name": "ACME Corporation",
"organization": true,
"organization_name": "ACME Corporation",
"contacts": [
{
"name": "Pedro",
"value": "(834) 362-5246",
"type": "phone"
}
],
"site_address": {
"formatted": "Passeig de Gràcia, 92, 08008 Barcelona, Spain",
"entrance_no": "1",
"apartment": null,
"floor": "1",
"description": "Entrance via Carrer de Procença",
"geolocation": {
"longitude": 37.6785237278356,
"latitude": 55.7862807707096
}
}
}
}
Client updated
{
"event_type": "client_updated",
"version": 3,
"context": {
"source": "web",
"happened_at": "2015-01-20T21:02:04.617Z",
"created_at": "2015-01-20T21:02:04.617Z",
"user_uuid": "8ebd12cc-b2d9-407c-a4f4-5943263d54a4",
"user_email": "jack@black",
"device_uuid": null
},
"client": {
"uuid": "07cf12b5-f2da-4a77-8065-11cac610ed84",
"external_id": "423430387320568-acme",
"name": "ACME Corporation edited",
"organization": true,
"organization_name": "ACME Corporation edited",
"contacts": [],
"site_address": {
"formatted": "Passeig de Gràcia, 92, 08008 Barcelona, Spain",
"entrance_no": "1",
"apartment": null,
"floor": "1",
"description": "Entrance via Carrer de Procença",
"geolocation": {
"longitude": 37.6785237278356,
"latitude": 55.7862807707096
}
},
"previous": {
"external_id": "423430387320568-acme",
"name": "ACME Corporation",
"organization": true,
"organization_name": "ACME Corporation",
"contacts": [
{
"name": "Pedro",
"value": "(834) 362-5246",
"type": "phone"
}
],
"site_address": {
"formatted": "Passeig de Gràcia, 92, 08008 Barcelona, Spain",
"entrance_no": "1",
"apartment": null,
"floor": "1",
"description": "Entrance via Carrer de Procença",
"geolocation": {
"longitude": 37.6785237278356,
"latitude": 55.7862807707096
}
}
}
}
}
Client removed
{
"event_type": "client_removed",
"context": {
"source": "web",
"happened_at": "2015-01-21T21:02:04.617Z",
"created_at": "2015-01-21T21:02:04.617Z",
"user_uuid": "8ebd12cc-b2d9-407c-a4f4-5943263d54a4",
"user_email": "jack@black",
"device_uuid": null
},
"version": 15,
"client": {
"uuid": "07cf12b5-f2da-4a77-8065-11cac610ed84",
"external_id": "423430387320568-acme",
"name": "ACME Corporation edited",
"organization": true,
"organization_name": "ACME Corporation edited",
"contacts": [],
"site_address": {
"formatted": "Passeig de Gràcia, 92, 08008 Barcelona, Spain",
"entrance_no": "1",
"apartment": null,
"floor": "1",
"description": "Entrance via Carrer de Procença",
"geolocation": {
"longitude": 37.6785237278356,
"latitude": 55.7862807707096
}
}
}
}