Skip to main content

How to fetch follow ups for a dealer

This endpoint allows you to retrieve follow-ups for a dealer with pagination, filtering, sorting, and grouping capabilities. You can fetch follow-ups in batches using filters such as task type, assignee, follow-up state, and date ranges.

To use this endpoint, you first need your credentials. If you don't already have one, please head over to the Authentication and Authorization page to see how you can request for credentials from us.

Request

HTTP request

POST  https://api.mykaarma.com/leads/followup/dealer/{dealerUUID}/list

Parameters

Required path parameters:

Parameter NameValueDescription
dealerUUIDstringUnique identifier for the dealer

Authorization

This request requires authorization. Include your credentials in the authorization header.

Request Body

Property NameTypeRequiredDescription
dealerDepartmentUUIDstringYesUnique identifier of the dealer's department
filterDataobjectYesFilter criteria for follow-ups. Send an empty object {} to fetch without filters
customerUUIDstringNoFetch follow-ups only for this customer
fromInsertDatestringNoStart of the insert date range (format: yyyy-MM-dd'T'HH:mm:ssZ, e.g. 2024-05-01T00:00:00+0000). Must be sent together with toInsertDate
toInsertDatestringNoEnd of the insert date range. Must be sent together with fromInsertDate
fromDueDatestringNoStart of the due date range. Must be sent together with toDueDate
toDueDatestringNoEnd of the due date range. Must be sent together with fromDueDate
fromOptInDatestringNoStart of the opt-in date range
toOptInDatestringNoEnd of the opt-in date range
entriesToBeSkippedintegerNoNumber of entries to skip for offset-based pagination (default: 0)
entriesLimitToBeFetchedintegerNoMaximum number of entries to fetch (default: 50)
lastFollowUpUUIDstringNoUUID of the last follow-up received in the previous page, for cursor-based pagination. If sent, followUpPaginationData is also required
followUpPaginationDataobjectNoDetails of the last follow-up received in the previous page. Required when lastFollowUpUUID is sent
filterViewGroupByTypestringNoGroups the results. One of: CUSTOMER, ASSIGNEE, DUE_DATE, INSERT_DATE, TASK_TYPE
filterViewSortByTypestringNoField to sort the results by. One of: TASK_TYPE, CUSTOMER, TASK, INSERT_DATE, DUE_DATE, ASSIGNEE (default: DUE_DATE)
sortOrderstringNoSort direction. One of: ASCENDING, DESCENDING (default: ASCENDING)

Filter Data Object

The filterData object is required, but all of its fields are optional. An empty object {} applies no filters.

Property NameTypeDescription
followUpStatusListarrayFilter by communication status of the follow-up. Values: SELECT_ALL, CALLED, NOT_CALLED, EMAILED, NOT_EMAILED, TEXTED, NOT_TEXTED, WHATSAPPED, NOT_WHATSAPPED
followUpStateListarrayFilter by the state of the follow-up. Values: SELECT_ALL, NOT_STARTED, SCHEDULED, COMPLETE
assigneesUUIDListarrayFilter by the UUIDs of the users the follow-ups are assigned to
followUpSourceUUIDListarrayFilter by task type UUIDs (e.g. the UUID of the Declined Services or No Show task type)
scheduledApptStatusListarrayFilter by appointment scheduling status. Values: SELECT_ALL, SCHEDULED, NOT_SCHEDULED

Follow-up Pagination Data Object

When using cursor-based pagination, send the lastFollowUpUUID along with followUpPaginationData populated from the last follow-up of the previous page.

Property NameTypeDescription
latestCustomerFNamestringCustomer first name of the last follow-up received
latestCustomerLNamestringCustomer last name of the last follow-up received
latestInsertDatestringInsert date of the last follow-up received (format: yyyy-MM-dd'T'HH:mm:ssZ)
latestDueDatestringDue date of the last follow-up received (format: yyyy-MM-dd'T'HH:mm:ssZ)
latestAssigneeFNamestringAssignee first name of the last follow-up received
latestAssigneeLNamestringAssignee last name of the last follow-up received
latestTaskTypestringTask type of the last follow-up received
latestTaskNamestringTask name of the last follow-up received

Sample Request

curl --location 'https://api.mykaarma.com/leads/followup/dealer/{dealerUUID}/list' \
--header 'accept: application/json' \
--header 'authorization: <your-credentials>' \
--header 'Content-Type: application/json' \
--data '{
"dealerDepartmentUUID": "dealer-department-uuid",
"entriesToBeSkipped": 0,
"entriesLimitToBeFetched": 10,
"filterData": {}
}'

Sample Request - With Filters

curl --location 'https://api.mykaarma.com/leads/followup/dealer/{dealerUUID}/list' \
--header 'accept: application/json' \
--header 'authorization: <your-credentials>' \
--header 'Content-Type: application/json' \
--data '{
"dealerDepartmentUUID": "dealer-department-uuid",
"entriesToBeSkipped": 0,
"entriesLimitToBeFetched": 10,
"fromDueDate": "2024-05-01T00:00:00+0000",
"toDueDate": "2024-05-31T23:59:59+0000",
"filterViewSortByType": "DUE_DATE",
"sortOrder": "ASCENDING",
"filterData": {
"followUpStateList": ["NOT_STARTED"],
"followUpSourceUUIDList": ["task-type-uuid"]
}
}'
Pagination
  • If entriesLimitToBeFetched is not provided, a default limit of 50 is applied
  • Use entriesToBeSkipped and entriesLimitToBeFetched together for offset-based pagination
  • For cursor-based pagination, send the lastFollowUpUUID and followUpPaginationData from the last follow-up of the previous page
  • Fetch follow-ups in batches using filters such as task type to send messages efficiently
Date ranges

from and to dates must always be sent as a pair, and the from date must not be after the to date. Sending only one of them returns a validation error.

Response

{
"statusCode": 200,
"error": null,
"warnings": null,
"followUpsList": [
{
"uuid": "follow-up-uuid",
"dealerUuid": "dealer-uuid",
"dealerDepartmentUuid": "department-uuid",
"customerUuid": "customer-uuid",
"customerFName": "John",
"customerLName": "Doe",
"address": null,
"phoneNumber": {
"communicationValue": "**********",
"commType": "TEXT",
"optOutStatus": "OPTED_IN",
"timeOfChange": "2024-07-26T20:29:44.000+00:00",
"canSendOptinRequest": false
},
"emailAddress": {
"communicationValue": "****************",
"commType": "EMAIL",
"optOutStatus": null,
"timeOfChange": null,
"canSendOptinRequest": null
},
"source": {
"uuid": "task-type-uuid",
"dealerUuid": "dealer-uuid",
"taskName": "Declined Service",
"taskDisplayName": "Declined Service",
"taskDescription": "Declined Services Task Type"
},
"vehicle": {
"id": 329048323,
"uuid": "vehicle-uuid",
"vehicleKey": null,
"isValid": true,
"vin": "1GBHK34K07E528181",
"make": "Chevrolet",
"model": "Silverado 3500 HD",
"year": "2007",
"lastMileage": null
},
"dealerOrder": {
"dealerOrderUuid": "order-uuid",
"orderNumber": "202405162",
"orderType": "RO",
"orderDate": "2024-05-16 08:00:00.0",
"createdDate": "2024-05-16 01:31:26.0",
"closeDate": "2024-05-16 01:32:18.0",
"orderStatus": "C",
"invoiceURL": "https://payment-files.mykaarma.com/...",
"daUuid": null,
"daFName": null,
"daLName": null
},
"assignee": {
"uuid": "user-uuid",
"fname": "Chetan",
"lname": "Rawat"
},
"taskName": "Air Conditioner/Heater Recommendation, Fluid Leak Repair Recommendation",
"lastVisitedDate": null,
"declineInfo": {
"dmsID": 9,
"hasReturned": null,
"mpiUUID": "mpi-uuid",
"declines": [
{
"declinedServiceID": null,
"opcode": null,
"opcodeDescription": null,
"internalName": "Air Conditioner/Heater Recommendation",
"internalDescription": "Air Conditioner Refrigerant Recharge and Leak Test",
"displayName": "Air Conditioner/Heater Recommendation",
"displayDescription": "Air Conditioner Refrigerant Recharge and Leak Test",
"type": "DeclinedRecommendation",
"source": "SERVICECART",
"recommendationUUID": "recommendation-uuid",
"amount": 253.0,
"status": null
}
],
"mpiLink": "scct.mkvwa42.com/p/lsfkjeorijrdes.html"
},
"dueDate": "2024-05-30T18:29:59.000+00:00",
"insertDate": "2024-05-15T18:30:00.000+00:00",
"textModeCurrentStatus": null,
"emailModeCurrentStatus": null,
"textMessageUuid": null,
"textMessageFollowupStatus": null,
"emailMessageUuid": "email-message-uuid",
"emailMessageFollowupStatus": "Complete",
"callMessageUuid": null,
"callMessageFollowupStatus": null,
"followedUpStatus": "Complete",
"isValid": true,
"appointments": null,
"noShowAppointmentInfo": null
}
]
}

Response Fields

FieldTypeDescription
statusCodeintegerHTTP status code (200 for success)
errorobjectError details if the request failed
warningsarrayWarning messages if any
followUpsListarrayList of follow-up objects

Follow-up Object Key Fields

FieldTypeDescription
uuidstringUnique identifier of the follow-up task
dealerUuidstringUnique identifier of the dealer
dealerDepartmentUuidstringUnique identifier of the dealer's department
customerUuidstringUnique identifier of the customer for whom the task belongs
customerFNamestringCustomer's first name
customerLNamestringCustomer's last name
addressobjectCustomer's address details
phoneNumberobjectCustomer's primary cell details
emailAddressobjectCustomer's primary email details
sourceobjectThe task type information (e.g., Declined Services, No Show)
vehicleobjectVehicle details
dealerOrderobjectDetails of the dealer order if the task is generated from it (present in the case of declined services)
assigneeobjectDetails of the user the task is assigned to
followedupByobjectDetails of the user who completed the follow-up
taskNamestringTask name
lastVisitedDatestringDate of the customer's last visit
declineInfoobjectDetails of the recommendations that are declined by the customer in the MPI
dueDatestringDue date of the task (in UTC)
insertDatestringInsert date of the task (in UTC)
textMessageFollowupStatusstringStatus if the follow-up is completed through text
emailMessageFollowupStatusstringStatus if the follow-up is completed through email
callMessageFollowupStatusstringStatus if the follow-up is completed through call
whatsappMessageFollowupStatusstringStatus if the follow-up is completed through WhatsApp
followedUpStatusstringStatus if the follow-up is completed through any of the modes
isValidbooleanIndicates if the follow-up is valid
appointmentsarrayList of appointments scheduled for the customer
noShowAppointmentInfoobjectInformation of the appointment through which the no show follow-up was created (only in the case of no show or missed appointment)
specialOrderInfoobjectInformation of the special order part if the task is generated from it (only in the case of special order parts follow-ups)

Error Responses

Validation failures return a 400 status code with an error object describing the problem.

ErrorCause
MISSING_DEALER_DEPARTMENT_UUIDdealerDepartmentUUID is missing in the request body
MISSING_FILTER_DATAfilterData is missing in the request body (send {} if no filters are needed)
INVALID_DATE_COMBINATIONA from/to date is sent without its pair, or the from date is after the to date
MISSING_COMPLETE_PAGINATION_INFOlastFollowUpUUID is sent without followUpPaginationData
INVALID_REQUESTThe request body is missing or malformed