Create Endpoint
Your endpoint must be able to process two types of HTTPS requests: Verification Requests and Event Notifications. Since both requests use HTTPs, your server must have a valid TLS or SSL certificate correctly configured and installed. Self-signed certificates are not supported.
The sections below explain what will be in each type of request and how to respond to them.
Verification Requests
Anytime you configure the Webhooks product in your community settings page, we'll send a GET request to your endpoint URL. Verification requests include the following query string parameters, appended to the end of your endpoint URL. They will look something like this:
Validating Verification Requests
Whenever your endpoint receives a verification request, it must:
Verify that the
verifyToken
value matches the string you set in the Verify Token field when you configure the Webhooks product in your community settings.(you will set up this token during configuring webhooks).
Respond body should should contain
challenge
value.
Event Notifications
When you configure your Webhooks product, you will subscribe to specific events on an object type (e.g., the status change event on the ticket object). Whenever such event happened, we will send your endpoint a POST request with a JSON payload describing the change. For example, let's say you set up a “Ticket”
Webhook and subscribed to “Status changed” event. If ticket’s status was changed from “open” to “pending”, we'd send you a notification that would look like this:
Payload Contents
We format all payloads with JSON, so you can parse the payload using common JSON parsing methods or packages.
We do not store any Webhook event notification data that we send you, so be sure to capture and store any payload content that you want to keep.
The structure of the JSON body you receive, will look like this:
More info about event payload structure you can get in the following document.
Responding to Event Notifications
Your endpoint should respond to all Event Notifications with 200 OK HTTPS. Your endpoint should respond to all webhook events in 20 seconds or less.
Last updated