CAP Gateway - API Documentation (Technical)
See our Onboarding and Testing processes for a clear outline of the steps we follow.
See our FAQ for clarification on time scales and testing.
If you have any questions or issues you can log a support ticket here.
Getting started
This documentation provides the necessary steps to authenticate with the CAP API, submit leads to the CAP Platform, and handle responses effectively. It includes detailed descriptions of the Authentication, payload structure, and example responses for both successful and non-successful scenarios.
Prerequisites
Before you can start the integration, you will require the following details from CAP:
Per Environment
API Key
Campaign ID
Source Acquisition Channel
Enquiry Type
Vehicle Names
Additional Required Fields for Campaign
Authorization
This API requires authentication using an static API key to access its endpoints. Your API key should be provided to you. Example API key: be12f0d522bb41968b7cf4f82c76fbc2.
Request Headers
Key | Value |
|---|---|
Content-Type | application/json |
X-API-Key | <YOUR_API_KEY> |
API Endpoints
Environment | Base URL |
|---|---|
QA | https://qa-api.cap-gateway.com |
Production | https://api.cap-gateway.com |
Method Type | Endpoint | Description |
|---|---|---|
POST | /lead-submission/v1/external | This endpoint allows the submission of leads including contact details, optin consents, and vehicle. |
Lead Submission
This endpoint allows external systems to submit leads, capturing essential details such as contact details, vehicle selected, and opt in consents.
Request URL
POST {baseUrl}/lead-submission/v1/externalRequest Body
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 enquiry 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 details 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 certain 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 Response
Accepted (202) - Leads that have passed validation and been accepted into CAP and will be subject to further processing.
Bad Request (400) - Leads that have failed validation, this indicates an issue with the data provided as part of the request. The response body will contain further details on the validation failure that has occurred.
Internal Server Error (500) - Requests which the CAP Gateway has failed to process, such as an exception will return with a status code of Internal Server Error.
API Response Codes And Error Messages
Response Codes
Code | Meaning |
|---|---|
202 | Lead submission accepted. |
400 | Bad request, validation error. |
401 | Unauthorized, invalid token. |
500 | Internal server error. |
Error Messages
Each error message points out a specific issue related to the submission. This could be the submission data, campaign configurations, or other entities like vehicles, and offers a general suggestion to either correct the submission or contact support.
Validation Messages
Validation messages will be formatted will show in the response in this format: “Property:{PropertyName}; ErrorMessage:{Message}“. See below for the list of messages.
E.g. "Property:ContactDetail.FirstName; ErrorMessage:'First Name' must not be empty."
Property | Error Message |
|---|---|
| "Metadata must not be empty." |
| "EnquiryDateTime must not be empty." |
| "EnquiryType must not be empty." |
| "EnquirySource must not be empty." |
| "AcquisitionChannel must not be empty." |
| "Vehicle must not be empty." |
| "Vehicle Name must not be empty." |
| "ContactDetail must not be empty." |
| "FirstName must not be empty." |
| "LastName must not be empty." |
| "EmailAddress must not be empty." |
| "PhoneNumber must not be empty." |
| "Address must be empty." |
| "Address must not be empty." |
| "Postcode must not be empty." |
| "Postcode is not in a valid format." |
| “Opt In Consents must not be empty” |
Setup & Campaign Messages
Error Type | Error Message | Description |
|---|---|---|
|
| General error indicating an issue with internally. User should contact support for further assistance. |
|
| The specified Campaign ID is invalid or missing on the field |
|
| The system could not find a campaign matching the provided Campaign ID. Verify the value in |
|
| The campaign has not started, so leads are not yet being accepted. Contact support if this is not expected. |
|
| The campaign has ended, and will not accept any more leads. Contact support if this is not expected. |
|
| The campaign is not currently active. Please contact support if this is not expected. |
|
| The specified vehicle could not be found for the given campaign. Verify the combination of the field values:
User should contact support for further assistance. |
|
| Could be due to an incorrect combination of the data on the fields:
User should contact support for further assistance. |
|
| The specified Acquisition Channel is invalid. Please verify the value specified in |
Need help?
See our Onboarding and Testing processes for a clear outline of the steps we follow.
See our FAQ for clarification on time scales and testing.
If you have any questions you log a support ticket here.