In this article, you'll learn how to set up webhooks via the Snov.io API for your custom integrations.
How to subscribe to webhooks via Snov.io API
How to manage webhooks via Snov.io API
Snov.io Webhooks allow you to:
- Integrate your own application with Snov.io
- Get notified of events or activities that happened in your Snov.io account
- Send real-time data from Snov.io to your application
What is a webhook and how does it work
You can use webhooks to call the endpoint (URL) on your server each time a chosen event happens in your Snov.io account.
Your system gets instant data about this event. You can use this data for your integrations and workflow automation.
Webhook parameters include the following:
- Object: Snov.io feature that triggers the webhook.
- Action: The specific event that triggers the webhook.
- Endpoint: The destination URL where webhook data is sent from Snov.io when triggered.
Whenever an event occurs, Snov.io sends an HTTP request with a JSON body to the specified URL-endpoint.
For example, when someone responds to your campaign email, Snov.io sends a request to your specified URL endpoint with the information about this event.
Currently supported webhook objects and actions are listed below:
Webhook object | Action | When triggered |
---|---|---|
campaign_email | sent | When any email is sent to the recipient in any drip campaign |
first_sent | When the first email is sent to the recipient in any drip campaign | |
opened | When a recipient opens any email from any drip campaign | |
campaign_reply | received | When the recipient responds to any email in any of the campaigns |
first_received | When the recipient responds to the email for the first time in any of the campaigns | |
company | found_domains_by_names | When you request a company's domain based on its name. |
prospect | found_by_li_url | When you request a prospect's profile info based on their LinkedIn URL. |
email_verification | verified | When you request email verification. |
How to manage webhooks via Snov.io API
You can subscribe to and manage webhooks through a set of API calls.
Subscribe to a webhook via API call
Use the settings below to make an API call in Postman or any other API testing environment of your choice:
Type: POST
URL: https://api.snov.io/v2/webhooks
Input parameters:
event_object
|
the object the action is performed on (list of supported objects) |
event_action
|
the action performed on the object (list of supported actions) |
endpoint_url
|
the URL address where the webhook is sent |
List all your webhooks
This API method allows you to get a list of webhooks on your account.
Type: GET
Request URL: https://api.snov.io/v2/webhooks
Input parameters: This method has no input parameters.
Delete a webhook subscription
Deletes a chosen webhook.
Include the unique “id” value of the chosen webhook at the end of the request URL address.
Use the "List all webhooks" method to get the id values of your webhooks.
Type: DELETE
Request URL: https://api.snov.io/v2/webhooks/webhook_id
Input parameters: This method has no input parameters.
Request URL example: https://api.snov.io/v2/webhooks/8
Change webhook status
Changes the status of a chosen webhook subscription.
Include the unique “id” value of the chosen webhook at the end of the request URL address.
Use the "List all webhooks" method to get the id values of your webhooks.
Type: PUT
Request URL: https://api.snov.io/v2/webhooks/webhook_id
Input parameters:
Request URL example: https://api.snov.io/v2/webhooks/14
Refer to the API documentation for technical details and response examples.
How to add a webhook via Snov.io API (example)
To see a webhook play out in real time, let's use Postman and any of the online endpoint generators.
1) Prepare API testing environment and get an API access token
- Sign up with Postman
- Get an API access token
- Prepare an API call and authenticate it with an access token
Here's a detailed walkthrough on getting your Snov.io API access token.
2) Get an endpoint URL address
For example, we will use the Beeceptor to generate a free endpoint. On their website, type in any endpoint name and click the Create Endpoint button.
You'll get an endpoint URL address to which a webhook and data related to an event in Snov.io will be sent. Save or copy this URL to use it in the next step.
3) Subscribe to a webhook via API call
Use the settings below to make an API call in Postman or any other API testing environment of your choice:
Type: POST
Request URL: https://api.snov.io/v2/webhooks
Input parameters (also refer to the Webhook parameters chapter above):
event_object | campaign_email | campaign_reply |
event_action | sent
first_sent opened |
received
first_received |
endpoint_url | https://snovio.free.beeceptor.com |
After entering all the parameters, click the Send button. You will see the following response:
Status: Active means you have successfully subscribed to a webhook.
4) Check webhook notification at the endpoint URL
We consider that a webhook was successfully received by the endpoint if it returns a 200 OK success status response code within 3 seconds.
If it doesn't, then we make several attempts to re-send a webhook:
1st: immediately after the event
2nd: 20 minutes after the last attempt (20 minutes after the event)
3rd: 40 minutes after the last attempt (1 hour after the event)
4th: 60 minutes after the last attempt (2 hours after the event)
5th: 4 hours after the last attempt (6 hours after the event)
6th: 8 hours after the last attempt (14 hours after the event)
7th: 24 hours after the last attempt (38 hours after the event)
If all seven attempts are unsuccessful, the webhook is deactivated.
Go back to Beeceptor and find a POST record with Snov.io webhook data. Here's an example of how it looks:
After you've subscribed to a webhook, every time a chosen event happens in your Snov.io account, the data related to the event will be instantly passed on to the URL endpoint.
Sorry about that 😢
How can we improve it?