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 Name | Value | Description |
---|---|---|
departmentUUID | string | Unique identifier of dealer department |
userUuid | string | Unique identifier of user |
customerUuid | string | Unique identifier of customer |
Authorization
This request requires the following authorization scopes:
Scope | Level | Description |
---|---|---|
message.create | DealerDepartment | Authorizes client to send text to customers for the provided user's dealer department |
Request Body
Property Name | Value | Description |
---|---|---|
messageAttributes | object | Object having attributes of the message |
messageAttributes.body | string | Message body of the text to be sent out |
messageAttributes.isManual | boolean | Whether the message is being sent out manually by a user's action or automatically by a system |
messageAttributes.protocol | string | Set its value to TEXT for sending the text message |
messageAttributes.type | string | Set its value to OUTGOING |
messageSendingAttributes | object | Object having attributes for sending of the message |
messageSendingAttributes.communicationValueOfCustomer | string | (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.sendSynchronously | boolean | (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.callbackURL | string | (Optional) If sending text asynchronously then pass a callbackURL here to receive update when text sending is attempted |
messageSendingAttributes.callbackMetaData | object | (Optional) Additional metadata you want us to post with the above status callback's payload |
messageSendingAttributes.addTCPAFooter | boolean | (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.addSignature | boolean | (Optional) If set to true then -- {User's name} is appended. Default value: false |
messageSendingAttributes.addFooter | boolean | (Optional) If set to true then -- {Footer for the dealership configured in myKaarma records} is appended. Default value: false |
messageSendingAttributes.addFooter | boolean | (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"
}
]
}