Using Convertr APIs? Subscribe here to receive email notifications for development changes that may impact your implementation.
Overview
The Convertr platform allows Publishers to deliver leads to the platform using the Campaign webhook. The webhook allows a user to post data to a campaign using the Campaign API key. All API's are subject to rate limits which you can learn more about here: Convertr API Rate Limits
This document will take you through the different API calls, requests and endpoints you need to get this set up in your own system.
Contents:
- Retrieving your Campaign API Key
- Using the Campaign API Key
-
- Form Fields Endpoint
-
- Example Form Fields Request
- Example Form Fields Response
-
- Form Fields Endpoint
- Campaign Links Endpoint
-
- Example Campaign Links Request
- Example Campaign Links Response
-
- Campaign Lead Post Endpoint
-
- Example Lead Post Request
- Example Lead Post Request with Publisher ID
- Example Lead Post Payload (unencoded)
- Example Lead Post Response
-
-
- Error Responses
Related documents:
Retrieving your Campaign API Key
1. Within a campaign, navigate to Admin>Setup
2. 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.
Using the Campaign API Key
Form Fields Endpoint
This API call will supply an array of forms along with the form fields on the campaign.
Example Form Fields Request:
GET request - Campaign Form Fields
https://{enterprise}.cvtr.io/webhook/campaign/{CampaignId}/global-form/fields?apikey={campaignAPIkey}
Example Form Fields Response:
GET response - Campaign Form Fields
[
{
"formName": "Form Fields Endpoint",
"formId": 75,
"fields": [
"form[firstName]",
"form[lastName]",
"form[email]",
"form[telephone]"
]
}
]
Campaign Links Endpoint
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.
Example Campaign Links Request:
GET request - Campaign Links
https://{enterprise}.cvtr.io/webhook/campaign/{campaign_id}/links?apikey={campaign_API_key}
Example Campaign Links Response:
GET response - Campaign Links
[
{
"id": 135,
"name": "Campaign Links Endpoint",
"channel": "Email",
"destination": "https://Campaign-Links-Endpoint.cvtr.io/lp/Campaign-Links-Endpoint"
}
]
Campaign Lead Post Endpoint
The API call will allow you to post leads to the given campaign.
Example Lead Post Request
POST request - Lead Data
https://{enterprise}.cvtr.io/webhook/campaign/[campaign_id]/global-form/{global_form_id}/leads?apikey={campaign_api_key}&campaignLinkId={link_id}
Example Lead Post Request with Publisher ID
Additionally, if you would like to pass the publisher ID with the lead, you can post as below:
POST request - Lead Data & Pub ID
https://{enterprise}.cvtr.io/webhook/campaign/{Campaign_id}/global-form/{global_form_id}/leads?apikey={campaign_api_key}&campaignLinkId={link_id}&publisherId={publisher_id}
To get your Publisher ID, log into the platform and under the ID column identify your ID
Example Lead Post Payload (Unencoded)
POST request - Lead Data Payload
form[firstName]=Joe&form[lastName]=Bloggs&form[email]=tech@convertr.io&form[telephone]=02036177659
Example Lead Post Response
POST response - Lead Data
{
"code": 201,
"message": "Lead was created successfully",
"data": 55907
}
Error Responses
Error Code | Error Body |
404 | The server returned a "404 Not Found" |
400 | {"code": 400,"message": "Validation failed","data": [{"message": "This form should not contain extra fields."},{"fieldName": "form[field name]","message": ""}]} |
400 | {"code": 400,"message": "Validation failed","data": [{"message": "This form should not contain extra fields."}]} |
401 | {"code": 401,"message": "Access denied."} |
404 | {"code": 404,"message": "Publisher not found"} |
500 | {"code": 500, "message": ""} |
403 | {"code": "403","error": "Campaign is inactive"} |