CAP Gateway - API Documentation (Simplfied)
Lead submission
To submit a lead make a post request to one of the following URLs
Environment | URL |
|---|---|
QA | |
Production | https://api.cap-gateway.com/lead-submission/v1/external |
The following headers are required to submit a lead
Key | Value |
|---|---|
Content-Type | application/json |
X-API-Key | <YOUR_API_KEY> |
Payload description
Property | Type | Required | Supplied by CAP | Description |
|---|---|---|---|---|
| object |
|
| Information about the campaign and enquiry details. |
| guid | Unique ID of the marketing campaign. | ||
| DateTime |
| Date and time the lead was made. ISO 8601 format, Coordinated Universal Time (UTC), to the second. "T" is a delimiter between the date and time. | |
| string |
|
| External system reference ID for tracking. Client’s reference ID. |
| string | Type of enquiry. Accepted Values: “Test Drive”, “Quotation”, “Retailer Contact”, “KMI”, “Interest Only”, “Register Of Interest” | ||
| string |
|
| The IP address of the user. |
| string | The acquisition channel for the enquiry. | ||
| object |
| Contains the contact information of the person submitting the enquiry. | |
| string |
| First name of the individual. | |
| string |
| Last name of the individual. | |
| string |
| Email address of the individual. | |
| string |
|
| Phone number of the individual. +44 or 0 prefix accepted. Required for certain campaigns |
| string |
|
| Postcode of the individual's address. Required for cetain campaigns |
| object |
| Contains consent data for different communication channels. | |
| boolean |
|
| Opt-in status for the communication channel Accepted values: true, false, null |
| boolean |
|
| Opt-in status for the communication channel Accepted values: true, false, null |
| boolean |
|
| Opt-in status for the communication channel Accepted values: true, false, null |
| boolean |
|
| Opt-in status for the communication channel Accepted values: true, false, null |
| string | Name of the vehicle the user is interested in. |
Example payload
{
"metadata": {
"campaignId": "966c7488-bfa7-45b5-8510-d26ba3008879",
"enquiryDateTime": "2024-09-12T10:20:59.52",
"externalReferenceId": "9cf5ae87-aafb-43e5-b4d3-9d72367a2b86",
"enquiryType": "Test Drive",
"ipAddress": null,
"enquirySource": {
"acquisitionChannel": "Google"
}
},
"contactDetail": {
"firstName": "test",
"lastName": "test",
"emailAddress": "test@cap.co",
"phoneNumber": "+4420 8759 9036",
"address": {
"postcode": "L39AG"
}
},
"optInConsents": {
"PhoneCall": true,
"Post": false,
"Email": false,
"Sms": false
},
"vehicle": {
"name": "Audi Q6 e-tron"
}
}
Responses
Successful response example:
{
"success": true,
"messages": [],
"result": {
"requestReferenceId": "e05072f9-ae85-42e2-ba42-c13449e5abaf",
"enquiryReferenceCode": "ENQ-240912-AZGCM0F8"
}
}
Failed response example:
{
"success": false,
"messages": [
"ERROR_SPECIFIC_MESSAGE_HERE"
],
"result": {
"requestReferenceId": "08585f67-6d4d-4272-ac0a-342ac0edcb8c",
"enquiryReferenceCode": null
}
}
Error codes:
Code | Meaning |
|---|---|
202 | Lead submission accepted. |
400 | Bad request, validation error. |
401 | Unauthorized, invalid token. |
500 | Internal server error. |
For a full list of possible errors please refer to our detailed documentation here.