Configuring a Webhook
On the PixelBin Platform, you can create and configure a webhook. Moreover, there's an option to view the logs of all your configured webhooks in which you can check the event, the payload, the status, and many more.
To check all your configured webhooks, go to the Webhooks
section on the Settings
page.
Creating a Webhook
- You must have a webhook endpoint (HTTPS URL) that is configured to receive a POST request from us.
- The webhook endpoint must return a 200 response status code on success.
- If you have a private server, make sure you whitelist the following IP address (15.207.198.197).
Either click on the Create Webhook
button at the top-right on the webhook list page or on the Create your first Webhook
button if no webhook is configured yet.
In the Webhook Settings section:
- Give a name to the webhook.
- Enter a valid HTTPS endpoint.
- Optionally you can enter a secret key to verify the authenticity of the webhook request and payload.
In the Events section:
- Choose one or more events and select the event type from the drop-down. You may subscribe to more than one event, else create a separate webhook for other events. If your webhook URL can handle payloads of multiple events, you may select additional events.
- Test the webhook to check whether it works correctly (read more in Webhook Testing).
Click Save.
You've successfully configured your webhook.
Editing a Webhook
Once you create a webhook, it will appear in the list of webhooks. You can click on an existing webhook and edit its details.
At any point in time, you can edit an existing webhook to do the following:
- Change the name
- Enter a new webhook URL
- Change the secret key
- Add or remove event types
Click Save once you're done editing the details.
Enabling or Disabling a Webhook
In case you wish to cancel listening to a webhook, use the toggle button to turn OFF the webhook. You'll no longer receive notifications for that event.
You can use the same toggle button to turn ON the webhook and re-listen to the event.
Deleting a Webhook
By deleting a webhook, all its configuration along with its logs will be deleted.
Listening to a Webhook
Use a tool like Ngrok to make your webhook endpoint publicly accessible for testing webhook implementation.
All webhook bodies are JSON encoded. The schema of the body may differ based on the event type, but the following fields are common.
Field | Data Type | Description |
---|---|---|
event.name | String | Name of the event |
event.type | String | Sub type of the event |
event.traceId | String | Unique id of the webhook request |
payload | Object | Payload send as body to the webhook URL |
To learn more about the response payload, go to Events