Sends an SMS or WhatsApp message from the practice's number to one of the client's numbers or one of its contacts' (matched by phone lookup key; any other number is a 400). Free text (body), on WhatsApp a template (contentSid + contentVariables), or a practice text template (templateCode: rendered here for the client and the contact holding the number, and sent as free text; 400 when it does not exist or is not for the channel), exactly one. The message is stored at once from the Messaging Service's answer and returned as 201; its delivery status then follows from the service's events. A provider refusal is still a 201, with status Failed and errorCode/errorMessage. The conversation is matched to the client (and to the contact when one of the client's contacts holds the number) unless it is already matched. 409 when messaging is off or not set up, when the number has opted out, or for WhatsApp free text more than 24 hours after the recipient's last WhatsApp message (send a template); the service's text is passed through. 503 when the service or Twilio is unavailable.
Requires: Create on Messaging.
Parameters
| Name | Type | Description |
|---|---|---|
| tenant* | path string | The Tenant.Code |
The Tenant.Code |
||
| client* | path string | |
Request Body*
{
"channel": "Sms",
"body": "string",
"contentSid": "string",
"contentVariables": {},
"templateCode": "string",
"to": "string"
}