Register a webhook
Some tooltip text!
• 1 minute to read
• 1 minute to read
Send the following request to register a webhook:
POST /api/v1/Webhook HTTP/1.1
Content-Type: application/json
{
"Name": "Tonys Contact Handler",
"Events": [
"contact.created",
"contact.changed",
"contact.deleted"
],
"TargetUrl": "https://www.myserver.com/superoffice/webhookhandler",
"Secret": "Something Super Secret",
"State": "Active",
"Type": "webhook"
}
This will register the webhook, and check that the TargetUrl
responds to a test POST. The TargetUrl
must:
- be HTTPS
- have a valid TLS certificate.
- respond 200 OK when it receives a POST with a test event.
When the event(s) happen (contact.changed
for example), then the target URL is notified by HTTP POST using a message like the one shown here:
{
"EventId": "8337ae4a-1dd6-40fd-8dc7-a050664a0af7",
"Timestamp": "2018-04-24T07:50:50.6812131Z",
"Changes": [
"contact_id",
"associate_id",
"department",
"updated_associate_id",
"updated",
"updatedCount"
],
"Event": "contact.changed",
"PrimaryKey": 994863,
"Entity": "contact",
"ContextIdentifier": "Cust1234",
"ChangedByAssociateId": 316,
"WebhookName":"Name you provided"
}