Messaging

Send an outbound SMS message with a text body or a canned message template.

With user_id, the SMS is sent on behalf of that user and shows the user as its agent in CDRs. The request returns 422 and sends nothing when the user is not one that Get list of users returns, such as a deleted user or a user of another contact center (errors.user_id: "must exist"); when the user lacks the Send SMS and view SMS history permission, set in the user's security access group, or on the user form where the contact center does not use security access groups (errors.user_id: "must be allowed to send SMS"); or when the canned message is shared with none of the user's teams (errors.message.content_data.canned_message_id: "must be shared with a team of the user").

post/api/v4/messaging/sms

Request

Request body

phone_numberstring phone required

The recipient's phone number.

user_idinteger

The ID of the user the SMS is sent on behalf of. It is the id that Get list of users (GET /api/v4/users) returns; to find the user by extension, call Get list of users with the extension filter.

Example request

{
  "phone_number": "18885658889",
  "sender_id": "18885658880",
  "user_id": 1,
  "message": {
    "content_type": "text",
    "content_data": {
      "body": "Hello, your order has been shipped."
    }
  },
  "source": {
    "system": "zoho",
    "account_id": "123321"
  }
}

Response

Created

Example response

{
  "sms": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
}

Changes