Skip to main content

How to post an internal note for a customer

This endpoint allows you to post an internal note within a customer conversation. These notes are not visible to the end customer; they are only shown within the customer conversation in myKaarma. There's also a functionality to tag users or user groups to notify them, but that is out of scope of this documentation at the moment.

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/communications/department/{department_uuid}/customer/{customer_uuid}/message

Parameters

Required path parameters:

Parameter NameValueDescription
department_uuidstringUnique identifier of dealer department
customer_uuidstringUnique identifier of customer

Authorization

This request requires the following authorization scopes:

ScopeLevelDescription
message.createDealerDepartmentAuthorizes client to create internal notes for the provided user's dealer department

Request Body

The request body contains the following main objects:

editor (Required)

The user on behalf of whom the internal note gets posted.

Property NameTypeDescription
uuidstringUnique identifier of the user
departmentUuidstringUnique identifier of the department
typestringType of editor, USER in this case

messageAttributes (Required)

Property NameTypeDescription
bodystringJSON string containing the message content. Structure: {"text":[{"type":{"code":"PLAIN_TEXT","value":"text/plain"},"value":"your message here"}],"version":0,"previewText":"your message here","annotations":[]}
typestringMessage type (set to NOTE for internal note)
protocolstringProtocol (set to NONE for internal note)
isManualbooleanPass it as true
updateThreadTimestampbooleanPass it as true
updateTotalMessageCountbooleanPass it as true
showInCustomerConversationbooleanPass it as true
messageTagsarrayArray of message tags

messageSendingAttributes (Optional)

Property NameTypeDescription
addSignaturebooleanN/A, set to false
sendSynchronouslybooleanWhether to send synchronously
overrideOptoutRulesbooleanN/A, set to false

internalCommentAttributes (Optional)

Property NameTypeDescription
usersToNotifyarrayList of UUIDs of users to notify
usersSubscribedarrayList of subscribed users
usersUnSubscribedarrayList of unsubscribed users

Example

Post an Internal Note

curl --location 'https://api.mykaarma.com/communications/department/{department_uuid}/customer/{customer_uuid}/message' \
--header 'accept: application/json' \
--header 'authorization: <your-credentials>' \
--header 'Content-Type: application/json' \
--data '{
"editor": {
"uuid": "user_uuid",
"departmentUuid": "department_uuid",
"type": "USER"
},
"messageAttributes": {
"body": "{\"text\":[{\"type\":{\"code\":\"PLAIN_TEXT\",\"value\":\"text/plain\"},\"value\":\"test internal\"}],\"version\":0,\"previewText\":\"test internal\",\"annotations\":[]}",
"type": "NOTE",
"protocol": "NONE",
"isManual": true,
"updateThreadTimestamp": true,
"updateTotalMessageCount": true,
"showInCustomerConversation": true,
"messageTags": []
},
"messageSendingAttributes": {
"addSignature": false,
"sendSynchronously": true,
"overrideOptoutRules": false
},
"internalCommentAttributes": {
"usersToNotify": [],
"usersSubscribed": [],
"usersUnSubscribed": []
}
}'

Response

Success

If the request is successful, the API returns a 200 OK status code with a JSON response containing the details of the created message.

{
"messageUUID": "message_uuid",
"customerUUID": "customer_uuid",
"status": "SUCCESS",
"errors": [],
"warnings": [
{
"warningCode": "WARNING_CODE",
"warningDescription": "Warning description"
}
]
}

Failure

If the request fails, the API returns a 400 BAD REQUEST, 501 NOT IMPLEMENTED, or 500 INTERNAL SERVER ERROR status code with a JSON response containing a list of errors.

{
"status": "FAILURE",
"errors": [
{
"errorCode": "ERROR_CODE",
"errorDescription": "Error description"
}
],
"warnings": [
{
"warningCode": "WARNING_CODE",
"warningDescription": "Warning description"
}
]
}

Error Codes

The following error codes may be returned:

Error CodeDescription
MISSING_MESSAGE_ATTRIBUTESMessage attributes are missing in the request.
INVALID_USEREditor details are invalid, or users to notify have invalid fields.
MISSING_MESSAGE_TYPEThe type field is missing in message attributes.
MISSING_MESSAGE_PROTOCOLThe protocol field is missing in message attributes.
MISSING_IS_MANUALThe isManual field is missing.
MISSING_MESSAGE_BODYThe message body is empty and no attachments are provided.
MISSING_FREEMARKER_METADATAFreemarker metadata is missing for a freemarker message.
INVALID_CUSTOMERThe provided customer UUID is invalid.
NOT_IMPLEMENTEDThe requested functionality (e.g., non-NONE protocol for NOTE type) is not implemented.
INTERNAL_SERVER_ERRORAn unexpected error occurred on the server.