Skip to main content

How to send a text to customer

To send a text to a customer, 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/
/user/
/customer/
/message

Parameters

Required path parameters:

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

Authorization

This request requires the following authorization scopes:

ScopeLevelDescription
message.createDealerDepartmentAuthorizes client to send text to customers for the provided user's dealer department

Request Body

Property NameValueDescription
messageAttributesobjectObject having attributes of the message
messageAttributes.bodystringMessage body of the text to be sent out
messageAttributes.isManualbooleanWhether the message is being sent out manually by a user's action or automatically by a system
messageAttributes.protocolstringSet its value to TEXT for sending the text message
messageAttributes.typestringSet its value to OUTGOING
messageSendingAttributesobjectObject having attributes for sending of the message
messageSendingAttributes.communicationValueOfCustomerstring(Optional) Phone number of the customer. Note: It should be a valid phone number of the customer for the respective dealer department in myKaarma records.
If this value is not set in the request then a valid preferred phone number of the customer, if present in myKaarma records gets picked
messageSendingAttributes.sendSynchronouslyboolean(Optional) After performing preliminary validations if this is set to true then request is posted to the Text-sending service (Twilio) synchronously before sending back the response. If it is false then message sending is attempted asynchronously (with retries built-in to handle failures in posting to the third party Texting service) and then an update is posted to the below mentioned callbackURL if provided
messageSendingAttributes.callbackURLstring(Optional) If sending text asynchronously then pass a callbackURL here to receive update when text sending is attempted
messageSendingAttributes.callbackMetaDataobject(Optional) Additional metadata you want us to post with the above status callback's payload
messageSendingAttributes.addTCPAFooterboolean(Optional) If set to true then Text STOP to opt-out (configurable per dealership) is appended to the text being sent. Default value: true
messageSendingAttributes.addSignatureboolean(Optional) If set to true then -- {User's name} is appended. Default value: false
messageSendingAttributes.addFooterboolean(Optional) If set to true then -- {Footer for the dealership configured in myKaarma records} is appended. Default value: false
messageSendingAttributes.addFooterboolean(Optional) If set to true then sends vCard of the department's number with the text message. Default value: false

Sample Curl

curl --location --request POST 'https://api.mykaarma.com/communications/department/{{departmentUUID}}/user/{{userUuid}}/customer/{{customerUuid}}/message' \
--header 'accept: application/json' \
-u "{{username}}:{{password}}" \
--header 'Content-Type: application/json' \
--data-raw '{
"messageAttributes": {
"body": "string",
"isManual": true,
"protocol": "TEXT",
"type": "OUTGOING"
},
"messageSendingAttributes": {
"communicationValueOfCustomer": "{{phoneNumber}}",
"sendSynchronously": false,
"callbackURL": "string",
"callbackMetaData": {
"additionalProp1": "string"
},
"addTCPAFooter": true,
"addSignature": false,
"addFooter": false,
"sendVCard": false
}
}'

Response

{
"customerUUID": "string",
"errors": [
{
"errorCode": "string",
"errorDescription": "string",
"errorUID": "string"
}
],
"messageUUID": "string",
"metaData": {
"additionalProp1": "string"
},
"requestUUID": "string",
"status": "SUCCESS",
"warnings": [
{
"warningCode": "string",
"warningDescription": "string"
}
]
}