AdOpt webhooks enable you to receive real-time notifications about important events related to your account. By setting up webhooks, you can get updated information directly in your system or external application, streamlining integration and automating processes.
1. Creating a Webhook
To create a webhook, follow these steps:
Go to the "Webhooks" tab in your AdOpt dashboard.
Look for the option to create a new webhook.
Fill in the required information, such as the webhook name and the target endpoint.
After saving the settings, your webhook will be ready to receive notifications.
2. Configuring the Signature
When creating a webhook, you will receive a unique secret signing key. This key will be used to validate the webhook's delivery. The webhook's payload consists of a JSON body containing the signature (HMAC) and relevant event data.
3. Receiving Events
When an event occurs, AdOpt will send a POST request to the configured webhook endpoint. The request will include a JSON body containing details about the specific event.
4. Validating the Call
To ensure the authenticity of the webhook call, you need to validate if the signature matches the HMAC of the request. The HMAC is calculated using the secret signing key provided in your AdOpt dashboard.
To validate the webhook call, follow these steps:
Retrieve the secret signing key from your AdOpt dashboard and save it in your system.
Calculate the HMAC using the secret signing key and the data received in the request body.
Compare the calculated HMAC signature with the signature included in the request.
If the signatures match, the webhook call is considered valid.
💡 Tip: It is highly recommended to implement security mechanisms to protect the integrity and confidentiality of transmitted data.
Conclusion
AdOpt webhooks are a powerful tool for receiving real-time notifications about critical events related to your account. By following the instructions provided in this documentation, you can securely configure and validate your webhooks, seamlessly integrating them into your system or external application.
