Skip to main content

How to get Freemarker data for a followup

This endpoint allows you to retrieve Freemarker template data for follow-ups. Use this when you have templates configured with isFreemarkerTemplate: true and need to get the evaluated template data before sending messages to customers.

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.

tip
  • If you are using a Freemarker template in the system, use this endpoint to fetch the template data
  • If you are not using a Freemarker template, evaluate the template on your end to prepare the message body
  • After getting the template data, follow the Communication API documentation to send a message to a customer

Request

HTTP request

POST  https://api.mykaarma.com/leads/followup/departments/{departmentUUID}/users/{userUUID}/freemarker/data

Parameters

Required path parameters:

Parameter NameValueDescription
departmentUUIDstringUnique identifier for the department of the dealer (use the department of the follow-up)
userUUIDstringUnique identifier of the user through whom the message will be sent

Authorization

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

Request Body

Property NameTypeDescription
followUpUuidsarrayList of unique identifiers for the follow-ups that need to be sent. Please only send 1 follow-up at a time

Sample Request

curl --location 'https://api.mykaarma.com/leads/followup/departments/{departmentUUID}/users/{userUUID}/freemarker/data' \
--header 'accept: application/json' \
--header 'authorization: <your-credentials>' \
--header 'Content-Type: application/json' \
--data '{
"followUpUuids": ["follow-up-uuid"]
}'
Important

Please only send 1 follow-up UUID at a time in the followUpUuids array.

Response

{
"statusCode": 200,
"error": null,
"warnings": null,
"followUpFreemarkerTemplateData": {
"followUpUuid": "follow-up-uuid",
"templateData": {
"customerName": "John Doe",
"vehicleMake": "Chevrolet",
"vehicleModel": "Silverado 3500 HD",
"taskName": "Declined Service",
"dueDate": "2024-05-30",
"declinedServices": [
{
"serviceName": "Air Conditioner/Heater Recommendation",
"amount": 253.0
}
]
}
}
}

Response Fields

FieldTypeDescription
statusCodeintegerHTTP status code (200 for success)
errorobjectError details if the request failed
warningsarrayWarning messages if any
followUpFreemarkerTemplateDataobjectObject containing the complete follow-up Freemarker data with all template variables populated

Next Steps

After retrieving the Freemarker data, use the Communication API to send the message to the customer using the template data.