Skip to main content

How to get conversations for a customer

To get customer conversations, 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 for credentials from us.

Request

HTTP request

POST  https://api.mykaarma.com/communications/department/
/user/
/customer/
/message/list

Parameters

Parameter NameValueDescription
departmentUUIDstringUnique identifier of dealer department
userUuidstringUnique identifier of user
customerUuidstringUnique identifier of customer

Authorization

This request requires following scopes

ScopeLevelDescription
communications.message.getDealerDepartmentAuthorizes client to get customer conversations for given dealer department

Request Body

Property NameValueDescription
lastMessageReceivedOndatetime(Optional) Conversations older than this date will be fetched. Format ISO 8601 yyyy-MM-dd'T'HH:mm:ssZ. Example 2025-01-01T00:00:00+0700. If this is not sent, latest maxResults conversations will be returned
protocolsSupportedlist(Optional) Filters on communication mode of conversations to be fetched. Possible values "TEXT", "EMAIL", "VOICE_CALL", "NONE" (Internal note / System event/notification). If this is not sent, filter will not be applied and all protocols conversations will be returned
messageUuidsReceivedAtSameTimelist(Optional) List of messageUUID's of all messages in last iteration having ReceivedOn date same as lastMessageReceivedOn . If this is not sent, the API call may return duplicate messages.
maxResultsinteger(Optional) Maximum number of customer conversations to be fetched in one API call. Default Value: 20
maxDraftsToBeFetchedinteger(Optional) Maximum number of conversation drafts to be fetched in one API call. Default Value: 100
fetchDraftsboolean(Optional) Boolean (true/false) indicating whether to fetch conversation drafts for customer or not. Default Value: false
isManualboolean(Optional) Boolean (true/false) indicating whether to fetch manually sent conversations or automatically sent conversation. If this field is null, both manually and automatically sent conversations will be fetched

Sample Curl

curl --location --request POST 'https://api.mykaarma.com/communications/department/{{departmentUUID}}/user/{{userUuid}}/customer/{{customerUuid}}/message/list' \
--header 'accept: application/json' \
-u "{{username}}:{{password}}" \
--header 'Content-Type: application/json' \
--data-raw '{
"fetchDrafts": false,
"isManual": null,
"lastMessageReceivedOn": "{{lastMessageReceivedOn}}",
"maxDraftsToBeFetched": 100,
"maxResults": 20,
"messageUuidsReceivedAtSameTime": [
"string"
],
"protocolsSupported": [
"TEXT","EMAIL","VOICE_CALL","NONE"
]
}'

Sample Response

{
"messagesMap": {
"MESSAGES": [
{
"id": 1,
"uuid": "messageUUID",
"messageType": "S",
"protocol": "X",
"fromName": "Alice",
"fromNumber": "1002876975",
"toName": "Bob",
"toNumber": "1005858588",
"messageSize": 287,
"sentOn": "2022-10-27T15:42:15.000+0000",
"receivedOn": "2022-10-27T15:42:15.000+0000",
"routedOn": "2022-10-27T15:42:15.000+0000",
"tags": null,
"emailMessageId": null,
"communicationUid": "twilioCommUUID",
"messagePurpose": "F",
"deliveryStatus": "1",
"dealerDepartmentUuid": "dealerDepartmentUuid",
"twilioDeliveryFailureMessage": null,
"numberofMessageAttachments": 0,
"isManual": true,
"customerUuid": "customerUuid",
"customerName": "Bob",
"dealerUuid": "dealerUuid",
"dealerAssociateUuid": "dealerAssociateUuid",
"isRead": false,
"isArchive": false,
"messageExtnDTO": {
"messageUuid": "messageUUID",
"messageBody": "Bob thank you for trusting me with your service needs. You should have received a short 5 question survey from Mercedes-Benz between 10/16 & 10/18 Please take a moment to fill out the survey for Me, my bonus is based on survey count !! Thank you so much, greatly appreciated!\n--Alice Mercedes-Benz of Silver Lake",
"subject": null
},
"draftMessageMetaDataDTO": {
"messageUuid": "messageUUID",
"status": "SENT",
"scheduledOn": "2022-10-27T15:47:00.000+0000",
"reasonForLastFailure": null,
"addSignature": false
},
"messageMetaDataDTO": {
"messageUuid": "messageUUID",
"metaData": "{\"ADD_SIGNATURE\":\"TRUE\"}"
},
"docFiles": [],
"messagePredictionDTOSet": null,
"messageTags": null
}
],
"DRAFT": [
{
"id": 2,
"uuid": "messageUUID",
"messageType": "F",
"protocol": "X",
"fromName": "Service Dept",
"fromNumber": null,
"toName": "Bob",
"toNumber": "1005858588",
"messageSize": 180,
"sentOn": null,
"receivedOn": null,
"routedOn": null,
"tags": null,
"emailMessageId": null,
"communicationUid": null,
"messagePurpose": "F",
"deliveryStatus": "1",
"dealerDepartmentUuid": "dealerDepartmentUuid",
"twilioDeliveryFailureMessage": null,
"numberofMessageAttachments": 0,
"isManual": false,
"customerUuid": "customerUuid",
"customerName": "Bob",
"dealerUuid": "dealerUuid",
"dealerAssociateUuid": "dealerAssociateUuid",
"isRead": false,
"isArchive": false,
"messageExtnDTO": {
"messageUuid": "messageUUID",
"messageBody": "\nBob,\n\nThank you for choosing MB of SL to service your vehicle. I wanted to follow up to see if you had any questions or concerns regarding your service.\n\nThank You,\nService\n \n",
"subject": "After Service Check"
},
"draftMessageMetaDataDTO": {
"messageUuid": "messageUUID",
"status": "SCHEDULED",
"scheduledOn": "2023-01-11T00:00:00.000+0000",
"reasonForLastFailure": null,
"addSignature": false
},
"messageMetaDataDTO": null,
"docFiles": [],
"messagePredictionDTOSet": null,
"messageTags": null
}
]
},
"requestUuid": "requestUuid",
"errors": null,
"warnings": null
}