Creates and sends an SMS campaign. Attachments for MMS campaigns are also accepted.
Messages will be sent using the channel that corresponds to the from
request parameter. The message body must be less than 1000 characters. Attachment-only messages are also accepted.
If there is no contact for the organization corresponding to the parameters in the to
list, a new contact will be created, along with a conversation with the from
number channel. If there is an existing contact but no conversation, a new conversation will be created.
All contacts will be tagged with an upload tag with a timestamp corresponding to the time of creation of the campaign.
The contacts in the to
list will be formatted to have a number in the E.164 format and then validated. If some of them are still invalid, they will be removed from the payload and processing will continue with the valid numbers. If no valid numnbers are left after all invalid ones are excluded, a 422 error will be returned.
When custom_data is provided, the contacts will be associated with a custom object. The custom object and its custom properties must be created before the campaign is created. When specifying custom data, the resource
field must be set to contact
or campaign_contact
in order to associate the custom data with the contact or the campaign contact respectively.
The campaign will be processed in the background, therefore a 202 Accepted
status is initally returned on success.