POST /messaging/v1/sms/messages/
Sends a message to multiple recipients using a send definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.
Name | Type | | Description |
---|
definitionKey | string | Required | Unique identifier of the definition. |
recipients | array | Required | Array of recipient objects that contain parameters and metadata for the recipients, such as send tracking and personalization attributes. Use this parameter to send to multiple recipients in one request. Use either the recipient or recipients parameter, but not both. |
recipients.contactKey | string | | Unique identifier for a subscriber in Marketing Cloud. Each request must include a contactKey. You can use an existing subscriber key or create one at send time by using the recipient’s email address. |
recipients.to | string | Required | Channel address of the recipient. |
recipients.messageKey | string | | Unique identifier used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Can be up to 100 characters, and there are no restricted characters. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected. |
recipients.attributes | object | | Information used to personalize the message for the recipient. Written as key pairs. The attributes match profile attributes, content attributes, or triggered send data extension attributes. |
subscriptions.resubscribe | boolean | | Forces the message send request to subscribe the mobile number back into a short code if a user may have requested STOP. Often used to ensure that critical transactional messages are delivered irrespective of a mobile number subscriber status. |
content.message | string | | Override for message content in the definition that you want sent with each message. Use substitution strings to personalize the content. |
attributes | object | | Information used to personalize the message for the request. Written as key pairs. The attributes match profile attributes, content attributes, or triggered send data extension attributes. |
Status | Name | Type | Description |
---|
202 | | | Request is accepted. Review example response. |
| requestId | string | The unique identifier of this request. |
| errorcode | string | Error code for the exception |
| messageKey | string | Unique identifier to track message send status. |
Response | Reason |
---|
202 Accepted | Request is accepted. Review example response. |
400 Bad Request | Invalid request |
403 Forbidden | Failed to pass authorization. |
500 Server Error | Internal error |