Multichannel message

Encoding : UTF-8

Authentication

Your "api-key" and "api-login" identifiers must be added in the headers.

Definition

This sends a multi channel {SMS/Voice SMS/RCS/Email/Live Chat} in modes:

  • simple (1 contact)
  • campaign (up to 500 contacts)
    You must indicate your phone numbers in the "recipients" parameter, which is an array containing objects of type "contact".

Special parameters

NameTypeDescription
channelstringChannel to send [‘sms’, ‘voice_sms’, ‘rcs’, ‘email’, ‘live_chat’]
textstringMessage text (from 1 to 1224 characters for SMS and Voice SMS; up to 3072 characters for RCS). For the RCS channel, this field is optional (empty value is allowed) when metadata.template_name is provided.
recipientsarray[{'phone_number': '+111222233334444'},...,{'phone_number': '+2222333334444555'}] or [{'email': '[email protected]'},...,{'email': '[email protected]'}] for email channel. For the email channel, each recipient can also carry an 'authorize_tracking_pixel' boolean, for ex: [{'email': '[email protected]'},{'email': '[email protected]', 'authorize_tracking_pixel': true},{'email': '[email protected]', 'authorize_tracking_pixel': false}]. For the live_chat channel, recipients can also contain a 'conversation_id' field.
senderstringSender of the message (if the user allows it). For SMS/Voice/Email/Live Chat: 3-11 alphanumeric characters (a-zA-Z0-9). For the RCS channel, this field is the RCS agent name configured in your Multichannel settings.
send_atstringWhen you want to send the campaign. Format: DateTime ISO8601 (for ex: "2018-10-03T07:42:39-07:00").
purposestringCampaign purpose: (transactional/alert or marketing) : ['alert','wholesale'].
list_namestringThis is the value representing to list name you want to create for those contacts
simulation_modeboolean(optional) If this value is 'true', your request will be simulated, and you will receive a fake result. Only some minimal validations will be executed.
recipient_trackingboolean"True" for getting back recipient tracking.
auto_optimize_textbooleanBy transmitting this field with "false" value, your text will not be optimized by Octopush robot (your message could contain unicode characters, or useless spaces that could increase the number of needed SMS for each contact).
auto_delete_optout_contactsbooleanSet this value to "true" when you want to ignore optout contacts from your payload.
Metadata
metadata.typestringCampaign Type: ['sms_premium','sms_low_cost'] of the SMS Campaign; ['voice_sms'] of the Voice VMS Campaign
metadata.with_repliesboolean"True" for getting back recipient replies
metadata.voice_genderstringVoice gender [‘male’, ‘female’].
metadata.voice_languagestringVoice Language [‘en-US’, ‘en-GB’, ‘el-GR’, ‘pl-PL’, ‘hu-HU’, ‘sv-SE’, ‘de-DE’, ‘es-ES’, ‘es-LA’, ‘fr-FR’, ‘it-IT’, ‘pt-BR’, ‘ru-RU’].
metadata.get_back_pressed_keysbooleanThis value is "true" when you want to get back pressed key.
metadata.request_idstring(optional) To avoid sending same request multiple times, set up a request ID. In case the duplication will be detected, a validation error will be returned. A request_id will expire after 24 hours.
metadata.emailing_servicestringThe emailing service for the email channel [‘mailbox’, ‘gateway’].
metadata.email_fromstringThe sender's email address for the email channel.
metadata.name_fromstringThe sender's name for the email channel.
metadata.cc_emailsarray(optional) The list of email addresses in copy (Cc) for the email channel (up to 10 addresses). For ex: ['[email protected]', '[email protected]'].
metadata.bcc_emailsarray(optional) The list of email addresses in blind copy (Bcc) for the email channel (up to 10 addresses). The blind copy is only attached to the first contact of the campaign. For ex: ['[email protected]'].
metadata.subjectstringThe subject for the email channel (max 1000 characters).
metadata.template_namestringThe template name used for the email, RCS, or SMS channel. When provided, the template content is used and the text field becomes optional.
metadata.body_formatstringThe email body format: ‘plain_text’ (default) or ‘html’. Applies only to the text field, not metadata.template_name.
metadata.languagestringThe language used for the unsubscription mention in the email channel.
metadata.opening_click_trackingboolean(optional, default true, email channel) Measure who opens your emails and which links are clicked. When 'false', neither opens nor clicks are tracked.
metadata.per_contact_trackingboolean(optional, default false, email channel) When 'true', opens and clicks are recorded individually for each contact, so you can identify precisely who interacted with the campaign. Each recipient is then tracked only if their consent allows it.
metadata.track_unknown_consentsboolean(optional, default true, email channel) Only used when 'per_contact_tracking' is 'true'. When 'true', recipients whose consent is unknown (no matching contact and no 'authorize_tracking_pixel' given) are still tracked.
metadata.unsubscribe_linkboolean(optional, email channel) Include an unsubscribe link. Always 'true' and not editable for marketing campaigns, defaults to 'false' for transactional ones.
metadata.message_typestringThe type of RCS message [‘simple_text’, ‘rich_card’]. Default is simple_text, for the RCS channel.
metadata.cardsarrayDefines visual cards with media and content, used when message_type is rich_card, for the RCS channel.
metadata.actionsarrayDefines interactive options (e.g., buttons), used when message_type is simple_text, for the RCS channel.

How Our API Deals With Incorrect Data

The API we provide will try to interpret your request as best it can. If a parameter has the wrong value, we will try to understand it anyway. If the parameter has the wrong type, we will try to format it as best we can. Thus, we have determined default values, which are indicated in our documentation. If a parameter could not be recognized or "fixed", we will ignore it, but your request will be sent.
If one of your parameters does not have the right value, or does not have the right type, we will try to:

  • "cast" (convert) it so that it can be understood.
  • format it (delete prohibited characters for example)

Important Considerations

Be careful with the number of contacts per request. For campaigns, a good use is to transmit several frames of 200 to 500 numbers at a time.

  • < 200: you multiply calls and waste connection time.
  • 500: the frame becomes heavy and the risk of data loss increases.

Request Body Example in JSON

SMS Campaign

{
   "channel": "sms",
   "text": "Hello, this is a test message.",
   "recipients": [
       {"phone_number": "+33111222333"},
       {"phone_number": "+33111222334"}
   ],
   "sender": "SenderName",
   "send_at": "2024-12-19T10:00:00-07:00",
   "purpose": "alert",
   "list_name": "sms_list",
   "simulation_mode": false,
   "recipient_tracking": true,
   "auto_optimize_text": true,
   "auto_delete_optout_contacts": true,
   "metadata": {
       "type": "sms_premium",
       "with_replies": true
   }
}

Voice SMS Campaign

{
   "channel": "voice_sms",
   "text": "Hello, this is a voice message test.",
   "recipients": [
       {"phone_number": "+33111222333"},
       {"phone_number": "+33111222334"}
   ],
   "sender": "SenderName",
   "send_at": "2024-12-19T10:00:00-07:00",
   "purpose": "alert",
   "list_name": "voice_sms_list",
   "simulation_mode": false,
   "auto_delete_optout_contacts": true,
   "metadata": {
       "type": "voice_sms",
       "voice_gender": "male",
       "voice_language": "en-US",
       "get_back_pressed_keys": true
   }
}

RCS Campaign

*Info In order to use this channel, you must first create your 'identity' that will be validated by Google. It's called an 'Agent'. And the agent creation wizard is available on your Octopush client back office.
You can also specify which RCS agent to use for this request by setting the sender field with the RCS agent name. If sender is not provided, the system will use the default RCS agent that you configured. You can find this name on the Multichannel settings page.
When metadata.template_name is provided, the text field is optional and can be empty. The message content is taken from the RCS template configured in your Octopush account.

{
   "channel": "rcs",
   "text": "Hello, this is a test RCS message.",
   "recipients": [
       {"phone_number": "+33111222333"},
       {"phone_number": "+33111222334"}
   ],
   "sender": "***",
   "send_at": "2024-12-19T10:00:00-07:00",
   "purpose": "alert",
   "list_name": "rcs_list",
   "simulation_mode": false,
   "auto_delete_optout_contacts": true,
   "metadata": {
       "with_replies": true
   }
}

RCS Campaign with template

{
   "channel": "rcs",
   "text": "",
   "recipients": [
       {"phone_number": "+33111222333"}
   ],
   "send_at": "2024-12-19T10:00:00-07:00",
   "purpose": "alert",
   "metadata": {
       "template_name": "welcome_rcs_template"
   }
}

Email Campaign

{
   "channel": "email",
   "text": "This is the content of your email.",
   "recipients": [
       {"email": "[email protected]", "authorize_tracking_pixel": true},
       {"email": "[email protected]", "authorize_tracking_pixel": false}
   ],
   "sender": "SenderName",
   "send_at": "2024-12-19T10:00:00-07:00",
   "purpose": "alert",
   "list_name": "email_list",
   "metadata": {
       "email_from": "[email protected]",
       "name_from": "Sender Name",
       "cc_emails": ["[email protected]", "[email protected]"],
       "bcc_emails": ["[email protected]"],
       "subject": "Test Email",
       "emailing_service": "gateway",
       "template_name": "welcome_email_template",
       "opening_click_tracking": true,
       "per_contact_tracking": true,
       "track_unknown_consents": false,
       "unsubscribe_link": true
   }
}

Live Chat Message

*Info For the 'live_chat' channel:

  • Each recipient must have at least one of phone_number, email or conversation_id.
  • When conversation_id is provided (UUID v4), the API will try to send the message using this conversation.
  • If the provided conversation_id does not match any conversation but phone_number or email is present for the same recipient, the API will fallback and try to resolve the Live Chat contact by phone_number/email.
  • At least one valid recipient must be resolved, otherwise a [recipients] field does not contain any valid recipient. error will be returned.
{
   "channel": "live_chat",
   "text": "Hello, this is a live chat message.",
   "recipients": [
       {
           "phone_number": "+33111222333"
       },
       {
           "email": "[email protected]"
       },
       {
           "conversation_id": "00000000-0000-0000-0000-000000000001"
       }
   ],
   "sender": "AgentName"
}

Server Response Example in JSON

Success of a SMS campaign

{
   "sms_ticket": "sms_5f3fbce61266e",
   "number_of_contacts": 5,
   "total_cost": 5.00502839,
   "number_of_sms_needed": 5,
   "residual_credit": 50.75,
   "message": "******"
}

Bad request from an SMS campaign

{
   "code": 121,
   "message": "Mention STOP is missing."
}

Success of a Voice SMS campaign

{
   "ticket_number": "voice_5f44ebf9e47b7",
   "number_of_contacts": 1,
   "total_cost": 0.05,
   "estimated_duration": 30,
   "residual_credit": 149.95
}

Bad request from a Voice campaign

{
   "code": 400,
   "message": "Payload validation error.",
   "errors":
   {
      "voice_language":
      {
         "code": 442,
         "message": "Voice language not supported."
      }
   }
}

Success of a Email campaign

{
   "ticket_number": "email_5f44ebf9e47b7",
   "number_of_contacts": 1,
   "total_cost": 0.05,
   "residual_credit": 149.95
}

Bad request from a Email campaign

{
   "code": 2005,
   "message": "[destination email] field should be valid."
}

Success of a Live chat message

{
   "ticket_number": null,
   "number_of_contacts": 1,
   "total_cost": 0.0,
   "residual_credit": 149.95
}
Body Params

Payload to send multi channel campaign.

string
enum
required
Allowed:
string
recipients
array of objects
Defaults to []
recipients
string
boolean
Defaults to false
date-time
string
enum
Allowed:
string
boolean
Defaults to false
boolean
Defaults to false
boolean
Defaults to false
boolean
Defaults to true
metadata
object
string | null
Headers
string
required

Your api login from your account

string
required

Your api key from your account

Responses

400

Bad request.

401

Unauthorized.

403

Forbidden to view.

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json