How to setup webhooks from external partners with endpoints in Meiro
This document will teach you how to set up webhooks from external partners for event collection in Meiro Events. In this article, we will be using SmartEmailing’s webhook in the examples.
Requirements before starting:
- Username and Password/API token from the account in partner’s app/website. These credentials are needed for setup and data collection.
- External partner’s API endpoint URL and documentation
3. Meiro Events database to be set up for data storage.
Setting up webhook:
Open the command prompt and use curl to set up the webhook.
For each event, enter the following command. This will create a webhook for each event type.
>> curl -X POST <source_url> -u "<username>":"<password/api_token>" -d
|
Eg:
>> curl -X POST https://app.smartemailing.cz/api/v3/web-hooks -u |
In <json_data_for_events>
of the above example, we have set our endpoint in Meiro Events and included a param with the event name, the events will be automatically parsed by Meiro events.
Check webhook set up:
To check if the webhook has been set up, you can either check if events are streaming into the database or run an API call to GET the webhooks being set up by entering the following command.
>> curl -X GET <source_url> -u "<username>":
|
Eg:
|
Here is an example output. It is important to check that the URL and event are matches the setup.
{ |