How to use webhooks
To receive webhook events in your application, follow these implementation steps:
Implementation process
- Identify the events you want to listen for and the payloads to parse
- Create a webhook endpoint as an HTTP endpoint on your local server
- Handle incoming requests by parsing the payloads and returning a 200 response status code
- Define the webhook in Mambo using your local HTTP endpoint URL
- Test that your webhook endpoint is receiving events properly
- Deploy your webhook endpoint so that it's publicly accessible
- Update the webhook defined in Mambo using your public HTTP endpoint URL
Testing environment
When defining the webhook with your local HTTP endpoint, you can associate it to a site you create specifically for testing your webhook. By doing this you are free to create mechanics, users and activities which you can use to test your webhook endpoint without impacting a live site.
Creating a webhook endpoint
Your webhook endpoint should be an HTTP server that can:
- Accept POST requests
- Parse JSON payloads
- Verify webhook signatures (see the security section)
- Process events based on the
eventfield - Return a 200 status code to acknowledge receipt
Defining webhooks in Mambo
To set up a webhook in Mambo:
- Navigate to the Webhooks section in your Mambo dashboard
- Click "Create Webhook"
- Enter your endpoint URL
- Select the events you want to receive
- Configure any additional settings
- Save your webhook configuration