Setup Webhook
This page will guide you in setting up your first webhook endpoint to receive events from ChatBrick.
Steps to Setup a Webhook
- Develop an HTTP endpoint in your application to receive webhook events.
- Register the development endpoint URL on ChatBrick.
- Test the webhook by triggering an example event.
- Deploy the endpoint to a production environment.
- Register the production endpoint URL on ChatBrick.
- Monitor the webhook events sent to the production endpoint.
1. Develop an HTTP endpoint in your application to receive webhook events.
You can use any programming language or framework to develop the endpoint. The endpoint should be able to receive POST
requests and process the payload sent by ChatBrick.
You should implement signature verification on your endpoint. Learn more about it in the signature verification documentation.
Upon receiving an event, you should respond with an HTTP 200 OK
to indicate that the event has been successfully processed on your end. If you do not respond with a 2xx
status, the webhook message will be resent with exponential backoff. Learn more about retries in the retries documentation.
2. Register the development endpoint URL on ChatBrick.
Register your development version of the webhook endpoint URL on ChatBrick to verify your implementation.
To register, go to 選單 > 系統設定 > 技術人員 > Webhooks 設定.
3. Test the webhook by triggering an example event.
After registering the development endpoint URL, you can test the webhook by triggering an example event.
To trigger an example event:
- Select the webhook endpoint you want to test.
- Click the “Test endpoint…” button.
- Select the event you want to test.
- Click the “Send example” button.
After completing the test, you can disable the webhook endpoint to stop receiving events.
4. Deploy the endpoint to a production environment.
After your webhook endpoint has been implemented and tested, deploy the endpoint to a production environment.
5. Register the production endpoint URL on ChatBrick.
After your production webhook is ready to receive events, register the production endpoint URL on ChatBrick.
To register, go to 選單 > 系統設定 > 技術人員 > Webhooks 設定.
6. Monitor the webhook events sent to the production endpoint.
You can monitor the webhook events sent to the production endpoint on the ChatBrick dashboard.
On the dashboard, you can view any failed events. If your endpoint is unable to ingest new events, disable the endpoint. Investigate the issue before re-enabling it.