The campaign webhook allows the user to post data to a Convertr campaign using a campaign API key to authenticate the request.
This endpoint also allows for cross-origin requests allowing client-side applications to POST data to Convertr.
Go to ‘Setup’ under the ‘Admin’ tab on the Convertr campaign overview dashboard
Once you are on the setup page, scroll down to the ‘Campaign API’ section. This is where you will see the ‘Campaign API Key’. This will present a code that will function as the access token for the duration of the campaign you have selected.
This API call will supply an array of forms along with the form fields on the campaign.
https://{enterprise}.cvtr.io/webhook/campaign/{campaign_id}/global-form/fields?apikey={campaign_api_key} |
[ { "formName": "Form Fields Endpoint", "formId": 75, "fields": [ "form[firstName]", "form[lastName]", "form[email]", "form[telephone]" ] } ] |
This API call will return an array of available links for the given campaign. The Link ID is optional but it does provide insight into which channel a lead entered the Convertr Platform.
https://{enterprise}.cvtr.io/webhook/campaign/{campaign_id}/links?apikey={campaign_api_key} |
[ { "id": 135, "name": "Campaign Links Endpoint", "channel": "Email", "destination": "https://Campaign-Links-Endpoint.cvtr.io/lp/Campaign-Links-Endpoint" } ] |
The API call will allow you to post leads to the given campaign.
https://{enterprise}.cvtr.io/webhook/campaign/{campaign_id}/global-form/{global_form_id}/leads?apikey={campaign_api_key}&campaignLinkId={link_id} |
Additionally if you would like to pass the publisher id with the lead you can post as below (the publisher ID can be obtained from the platform by going to the publisher section - https://[enterprise].cvtr.io/publisher/list).
https://{enterprise}.cvtr.io/webhook/campaign/{campaign_id}/global-form/{global_form_id}/leads?apikey={campaign_api_key}&campaignLinkId={link_id}&publisherId={publisher_id} |
form[firstName]=Joe&form[lastName]=Bloggs&form[email]=tech@convertr.io&form[telephone]=02036177659 |
{ "code": 201, "message": "Lead was created successfully", "data": 55907 } |
Error code | Error Body | Description | |
---|---|---|---|
1 | 500 |
| Internal server error. |
2 | 404 |
| Campaign ID incorrect, incorrect URL or Global Form ID does not exist |
3 | 404 |
| Publisher ID incorrect |
4 | 400 |
| The form field(s) submitted is/are incorrect and do not match the correct form mapping |
5 | 400 |
| Some form field(s) submitted in your request do not exist on the form |
6 | 401 |
| Access denied. Incorrect API key |
7 | 403 |
| Campaign is inactive |