Skip to main content

How to save a lead

This document is designed to help you understand how you can save a lead in myKaarma. To use this endpoint, you first need your credentials. If you don't already have one, head over to the Authentication and Authorization page to see how you can request credentials from us.

Parameters Used

Parameter NameDescriptionRequired
{{dealerUuid}}UUID of dealer which service subscriber is saving the leads forTrue
{{authorization}}Authorization: Basic generate using username passwordTrue

Request Body

Request Body object

{
"customer": {
"uuid": ""
},
"vehicle": {
"uuid": "",
"trackingId": "",
"topic": "",
"description": ""
},
"dealerDetails": {
"name": "",
"code": "",
"source": "MMC"
},
"services": [
{
"name": "",
"code": "",
"type": "",
"dueDate": ""
}
],
"campaign": {
"name": "",
"code": ""
},
"status": "NEW",
"lastContactDate": "",
"leadId": "",
"webId": "",
"leadType": "RECALL"
}

Quick summary of request body object fields

Parameter NameDescriptionRequiredDefault Value
{{dealerDetails.name}}Vendor Dealership name.False---
{{dealerDetails.code}}Vendor Dealership code.False---
{{dealerDetails.source}}Source of the lead can be MMC.True---
{{customer.uuid}}UUID of customer(issued by myKaarma) which is associated with the leadTrue---
{{vehicle.uuid}}UUID of vehicle(issued by myKaarma) of vehicle associated with the leadTrue---
{{vehicle.trackingId}}Tracking ID of the VehicleFalse---
{{vehicle.topic}}Topic associated with the VehicleFalse---
{{vehicle.description}}Service descriptionFalse---
{{services}}List of communication codes/opcodes associated with the leadTrue---
{{services.code}}code/opcodeTrue---
{{services.name}}code nameFalse---
{{services.type}}service typeFalse---
{{services.dueDate}}service due date in format yyyy-MM-ddFalse---
{{campaign.name}}name of the campaign applicableFalse---
{{campaign.code}}campaign codeFalse---
{{status}}Should be set to NEWTrue---
{{lastContactDate}}Last contacted date for the lead in UTC format yyyy-MM-dd HH:mm:ssZ.True---
{{leadId}}ID associated with the leadFalse---
{{webId}}Web ID associated with the leadFalse---
{{leadType}}the type of lead which will b saved in mykaarma . Currently we only support RECALL, SERVICE_DEMANDTrue---

Scope

Scope NameScope Level
lead.writeDealer Level

Endpoint

curl -X POST "https://api.mykaarma.com/leads/v2/dealer/{{dealerUuid}}" 
-H "accept: application/json"
-H "authorization: Basic {{authorization}}"
-H "Content-Type: application/json"
--d '{
"customer": {
"uuid": "{{test_customer_uuid}}"
},
"vehicle": {
"uuid": "{{test_vehicle_uuid}}",
"trackingId": "2-I509U2C",
"topic": "WITH_CONTRACT",
"description": "Maintenance management with accepted user agreements"
},
"dealerDetails": {
"name": "Test Imports LLC",
"code": "{{test_dealer_code}}",
"source": "MMC"
},
"services": [
{
"name": "MBVANS - AS - CC - Maintenance - Service A",
"code": "MBVANS - AS - CC - Maintenance - Service A",
"type": "business",
"dueDate": "2023-06-01"
}
],
"campaign": {
"name": "MBVANS",
"code": "A"
},
"status": "NEW",
"lastContactDate": "2023-06-08 11:00:00Z",
"leadId": "US000000111199002",
"webId": "2-39484871796",
"leadType": "RECALL"
}'

Response

Response Object (http status code other than 4XX)

{
"error":
{
"errorCode": "string",
"errorDescription": "string",
"errorUID": "string"
}
,
"isNewCreated": "boolean",
"prospectUuid": "string"
"statusCode": 0,
"warnings": [
{
"warningCode": "string",
"warningDescription": "string"
}
]
}

Response Object (http status code 4XX)

{
"timestamp": "yyyy-MM-ddTHH:mm:ss.SSSZ",
"status": 400,
"error": "Bad Request",
"message": "string",
"path": "string"
}

Response Object Explanation

{{prospectUuid}} uuid of the lead which was created/updated . {{isNewCreated}} which tells whether the lead is a newly created lead or an existing one