How to send webhook events to Convolo Leads API ?

Triggering calls through an API request

About webhooks

 

Sending JSON webhooks is an efficient way to transfer data from one application to another in real-time. This process involves the use of a webhook URL, which is provided by the receiving application (Convolo in this case), and acts as a phone number that the other application can call when an event occurs. The data is then sent over the web from the application where the event originally occurred, to the receiving application that handles the data. This data is known as the “payload” and is usually sent in either JSON or XML format.

 

Sending API calls to Convolo Leads

Our webhook expands on ways you can connect with your leads by turning webforms, shopping carts, or anything you want into an opportunity to be the first to lead. Now let’s look at some code examples of sending a JSON webhook to Convolo:

 

1. Save Convolo’s request URL https://app.convolo.ai/rest/v1/ext/add_call_api/ and choose if you prefer to submit a GET or POST request.

 
Example: JSON body for POST method and minimum required fields
{
	'widget_key': '%WIDGET_KEY%', // Widget key
	'api_key': '%API_KEY%', // API key
	'lc_number': '+1234567890' // leads's phone number
}
Example: GET method and minimum required fields
https://app.convolo.ai/rest/v1/ext/add_call_api/?widget_key={WIDGET_KEY}&api_key={API_KEY}&lc_number={number}
 

2. As in the examples above, each API request needs a widget to link the calls to and an API key, so we created additional articles on how to get them, and you can find instructions here, respectively: How to get a Widget Key? and How to get an API Key?

 

3. Now, you should have all that it takes to trigger a call to Convolo. But, you can submit additional data from form fields as needed by including optional custom parameters (you can find out more about custom parameters in our dedicated article here):

{
  "widget_key": "%WIDGET_KEY%",
  "api_key": "%API_KEY%",
  "lc_number": "+1234567890" // lead's phone number
  "lc_param_name": "John Doe", // lead's name
  "lc_param_email": "email@example.com", // lead's email
  "lc_param_message": "Hello, world!", // Message
  "lc_number_2": "+1234567892" // optional lead's second phone number, if provided"
  "country": "UK" // two letter ISO country code used for local number format conversion, if needed
}

Note: Our Webhook expands on ways you can connect with your leads by turning forms, shopping carts, or anything you want into an opportunity to be the first to lead. And starting calls with it can be as easy as following the steps below:

 

4. If you followed all the steps correctly, you should have a powerful API request ready to impress some leads. Great work! 🎉

 

Override a call group with custom operators (optional)

 
💡
Agents can also be defined using our Webhook, in case you want to change the regular call queue (set in the widget’s call routing settings) and, for example, send calls to a special agent who is not part of the call queue.
 

Add the custom parameters below and fill the fields with the contact information from your agent.

It is mandatory to follow this naming convention, otherwise, our webhook won’t recognize the agent definition.
"lc_param_agent05name": "James Smith",
"lc_param_agent05phone":"+1234567890"
 

lc_param_agent<replace this with your number of choice>name - custom agent name (e.g. lc_param_agent01name)

lc_param_agent<use the same number you set in the above field>phone - custom agent phone (e.g. lc_param_agent01phone). Phone numbers can be with trailing zero or without.

 

If you have any questions, please email us at support@convolo.ai

 
Did this answer your question?
😞
😐
🤩

Last updated on January 9, 2023