Request to send a message that may include fallback messages to a receiver

POST/v1/messages

Request to send a message that may include fallback messages to a receiver

Base URL
https://unifier-cpaas.sms.es
Authentication

API key — send it in the X-API-Key header.

Request

Body

The request body for sending the messages

application/json
messageobjectrequired
Show child attributes
msgIdstring
senderstringrequired

Based on the channel - for RBM is Agent ID - for SMS is Short Code and alphanumeric sender IDs - for Telegram is Bot's username - for WhatsApp is the phone number of the sender

receiverstringrequired

Based on the channel - for RBM, WhatsApp and SMS is a phone number - for Telegram is the numerical user's ID not the username

channelstringrequired

Channel identifier as returned by the API (rbm is RCS Business Messaging).

Possible values: rbm, sms, telegram, whatsApp, email, instagram, facebook
validityPeriodnumber
connectionCNamestring

Only needed for SMS messages that don't have a default Omnichannel_CName in whitelist.

dcsstring

Only needed for SMS messages and if the channel of the sender is in "auto"

Possible values: gsm, unicode, auto
bodyoneOfrequired
Show child attributes
oneOf of:
FileMessage · object
fileMessageobject
Show child attributes
namestring
urlstring
fileTypestring
mimeTypestring
sizeinteger
playingLengthstring
thumbnailNamestring
thumbnailUrlstring
thumbnailMimeTypestring
thumbnailSizeinteger
TextMessage · object
textMessageobject
Show child attributes
contentstring
AudioMessage · object
audioMessageobject
Show child attributes
namestring
urlstring
mimeTypestring
sizeinteger
playingLengthinteger
PictureMessage · object
pictureMessageobject
Show child attributes
namestring
urlstring
mimeTypestring
sizeinteger
thumbnailNamestring
thumbnailUrlstring
thumbnailMimeTypestring
thumbnailSizeinteger
VideoMessage · object
videoMessageobject
Show child attributes
namestring
urlstring
mimeTypestring
sizeinteger
playingLengthinteger
thumbnailNamestring
thumbnailUrlstring
thumbnailMimeTypestring
thumbnailSizeinteger
LocationMessage · object
locationMessageobject
Show child attributes
latitudenumber
longitudenumber
textstring
urlstring
ContactMessage · object
contactMessageobject
Show child attributes
namestring
emailstring
addressstring
phonestring
firstNamestring
lastNamestring
countrystring
languagestring
TemplateMessage · object
namestringrequired

WhatsApp template name.

languageCodestringrequired
componentsobject[]required
Show child attributes
typestringrequired
subTypestring
indexintegerrequired
parametersoneOf[]required
Show child attributes
oneOf of:
ComponentParameterCurrency · object
codestringrequired

The ISO 4217 currency code (e.g. "USD", "EUR", "GBP", "TRY", "INR"). This tells WhatsApp which currency to format.

amount1000integerrequired

The monetary amount multiplied by 1000.

fallbackValuestring

A plain text string that is displayed if the client device cannot localize the currency.

ComponentParameterDateTime · object
fallbackValuestringrequired
ComponentParameterDocument · object
linkstringrequired
ComponentParameterImage · object
linkstringrequired
ComponentParameterVideo · object
linkstringrequired
EmailMessage · object
emailMessageobject
Show child attributes
subjectstring
htmlContentstring
textContentstring
CardMessage · object
layoutobject

Rich card layout

Show child attributes
cardOrientationstring
Possible values: HORIZONTAL, VERTICAL
imageAlignmentstring

Required if cardOrientation is HORIZONTAL.

Possible values: LEFT, RIGHT
cardWidthstring
Possible values: SMALL_WIDTH, MEDIUM_WIDTH
contentobjectrequired

Content of a card message

Show child attributes
mediaobject

Media elements

Show child attributes
urlstring (uri)required
thumbnailUrlstring (uri)
heightstring
Possible values: SHORT_HEIGHT, MEDIUM_HEIGHT, TALL_HEIGHT
titlestring
descriptionstringrequired
suggestionsobject[]required
Show child attributes
textstringrequired
postbackstring
replyWithobject
Show child attributes
postbackstringrequired
openUrlobject
Show child attributes
urlstring (uri)required
dialNumberobject
Show child attributes
numberstringrequired
composeMessageobject
Show child attributes
numberstringrequired
textstringrequired
showMapLocationobject
Show child attributes
latitudenumber (double)required
longitudenumber (double)required
labelstring
urlstring (uri)
createCalendarEventobject
Show child attributes
titlestringrequired
descriptionstring
startstring (date-time)
endstring (date-time)
SuggestionsMessage · object

Suggestions message payload

suggestionsobject[]required
Show child attributes
textstringrequired
postbackstring
replyWithobject
Show child attributes
postbackstringrequired
openUrlobject
Show child attributes
urlstring (uri)required
dialNumberobject
Show child attributes
numberstringrequired
composeMessageobject
Show child attributes
numberstringrequired
textstringrequired
showMapLocationobject
Show child attributes
latitudenumber (double)required
longitudenumber (double)required
labelstring
urlstring (uri)
createCalendarEventobject
Show child attributes
titlestringrequired
descriptionstring
startstring (date-time)
endstring (date-time)
CarouselMessage · object

Carousel message payload

textstring
layoutobject

Rich card layout

Show child attributes
cardOrientationstring
Possible values: HORIZONTAL, VERTICAL
imageAlignmentstring

Required if cardOrientation is HORIZONTAL.

Possible values: LEFT, RIGHT
cardWidthstring
Possible values: SMALL_WIDTH, MEDIUM_WIDTH
contentobject[]required
Show child attributes
mediaobject

Media elements

Show child attributes
urlstring (uri)required
thumbnailUrlstring (uri)
heightstring
Possible values: SHORT_HEIGHT, MEDIUM_HEIGHT, TALL_HEIGHT
titlestring
descriptionstringrequired
suggestionsobject[]required
Show child attributes
textstringrequired
postbackstring
replyWithobject
Show child attributes
postbackstringrequired
openUrlobject
Show child attributes
urlstring (uri)required
dialNumberobject
Show child attributes
numberstringrequired
composeMessageobject
Show child attributes
numberstringrequired
textstringrequired
showMapLocationobject
Show child attributes
latitudenumber (double)required
longitudenumber (double)required
labelstring
urlstring (uri)
createCalendarEventobject
Show child attributes
titlestringrequired
descriptionstring
startstring (date-time)
endstring (date-time)
customobject

Optional key-value bag for client-specific metadata.

fallbackobject[]
Show child attributes
msgIdstring
senderstringrequired

Based on the channel - for RBM is Agent ID - for SMS is Short Code and alphanumeric sender IDs - for Telegram is Bot's username - for WhatsApp is the phone number of the sender

receiverstringrequired

Based on the channel - for RBM, WhatsApp and SMS is a phone number - for Telegram is the numerical user's ID not the username

channelstringrequired

Channel identifier as returned by the API (rbm is RCS Business Messaging).

Possible values: rbm, sms, telegram, whatsApp, email, instagram, facebook
validityPeriodnumber
connectionCNamestring

Only needed for SMS messages that don't have a default Omnichannel_CName in whitelist.

dcsstring

Only needed for SMS messages and if the channel of the sender is in "auto"

Possible values: gsm, unicode, auto
bodyoneOfrequired
Show child attributes
oneOf of:
FileMessage · object
fileMessageobject
Show child attributes
namestring
urlstring
fileTypestring
mimeTypestring
sizeinteger
playingLengthstring
thumbnailNamestring
thumbnailUrlstring
thumbnailMimeTypestring
thumbnailSizeinteger
TextMessage · object
textMessageobject
Show child attributes
contentstring
AudioMessage · object
audioMessageobject
Show child attributes
namestring
urlstring
mimeTypestring
sizeinteger
playingLengthinteger
PictureMessage · object
pictureMessageobject
Show child attributes
namestring
urlstring
mimeTypestring
sizeinteger
thumbnailNamestring
thumbnailUrlstring
thumbnailMimeTypestring
thumbnailSizeinteger
VideoMessage · object
videoMessageobject
Show child attributes
namestring
urlstring
mimeTypestring
sizeinteger
playingLengthinteger
thumbnailNamestring
thumbnailUrlstring
thumbnailMimeTypestring
thumbnailSizeinteger
LocationMessage · object
locationMessageobject
Show child attributes
latitudenumber
longitudenumber
textstring
urlstring
ContactMessage · object
contactMessageobject
Show child attributes
namestring
emailstring
addressstring
phonestring
firstNamestring
lastNamestring
countrystring
languagestring
TemplateMessage · object
namestringrequired

WhatsApp template name.

languageCodestringrequired
componentsobject[]required
Show child attributes
typestringrequired
subTypestring
indexintegerrequired
parametersoneOf[]required
Show child attributes
oneOf of:
ComponentParameterCurrency · object
codestringrequired

The ISO 4217 currency code (e.g. "USD", "EUR", "GBP", "TRY", "INR"). This tells WhatsApp which currency to format.

amount1000integerrequired

The monetary amount multiplied by 1000.

fallbackValuestring

A plain text string that is displayed if the client device cannot localize the currency.

ComponentParameterDateTime · object
fallbackValuestringrequired
ComponentParameterDocument · object
linkstringrequired
ComponentParameterImage · object
linkstringrequired
ComponentParameterVideo · object
linkstringrequired
EmailMessage · object
emailMessageobject
Show child attributes
subjectstring
htmlContentstring
textContentstring
CardMessage · object
layoutobject

Rich card layout

Show child attributes
cardOrientationstring
Possible values: HORIZONTAL, VERTICAL
imageAlignmentstring

Required if cardOrientation is HORIZONTAL.

Possible values: LEFT, RIGHT
cardWidthstring
Possible values: SMALL_WIDTH, MEDIUM_WIDTH
contentobjectrequired

Content of a card message

Show child attributes
mediaobject

Media elements

Show child attributes
urlstring (uri)required
thumbnailUrlstring (uri)
heightstring
Possible values: SHORT_HEIGHT, MEDIUM_HEIGHT, TALL_HEIGHT
titlestring
descriptionstringrequired
suggestionsobject[]required
Show child attributes
textstringrequired
postbackstring
replyWithobject
Show child attributes
postbackstringrequired
openUrlobject
Show child attributes
urlstring (uri)required
dialNumberobject
Show child attributes
numberstringrequired
composeMessageobject
Show child attributes
numberstringrequired
textstringrequired
showMapLocationobject
Show child attributes
latitudenumber (double)required
longitudenumber (double)required
labelstring
urlstring (uri)
createCalendarEventobject
Show child attributes
titlestringrequired
descriptionstring
startstring (date-time)
endstring (date-time)
SuggestionsMessage · object

Suggestions message payload

suggestionsobject[]required
Show child attributes
textstringrequired
postbackstring
replyWithobject
Show child attributes
postbackstringrequired
openUrlobject
Show child attributes
urlstring (uri)required
dialNumberobject
Show child attributes
numberstringrequired
composeMessageobject
Show child attributes
numberstringrequired
textstringrequired
showMapLocationobject
Show child attributes
latitudenumber (double)required
longitudenumber (double)required
labelstring
urlstring (uri)
createCalendarEventobject
Show child attributes
titlestringrequired
descriptionstring
startstring (date-time)
endstring (date-time)
CarouselMessage · object

Carousel message payload

textstring
layoutobject

Rich card layout

Show child attributes
cardOrientationstring
Possible values: HORIZONTAL, VERTICAL
imageAlignmentstring

Required if cardOrientation is HORIZONTAL.

Possible values: LEFT, RIGHT
cardWidthstring
Possible values: SMALL_WIDTH, MEDIUM_WIDTH
contentobject[]required
Show child attributes
mediaobject

Media elements

Show child attributes
urlstring (uri)required
thumbnailUrlstring (uri)
heightstring
Possible values: SHORT_HEIGHT, MEDIUM_HEIGHT, TALL_HEIGHT
titlestring
descriptionstringrequired
suggestionsobject[]required
Show child attributes
textstringrequired
postbackstring
replyWithobject
Show child attributes
postbackstringrequired
openUrlobject
Show child attributes
urlstring (uri)required
dialNumberobject
Show child attributes
numberstringrequired
composeMessageobject
Show child attributes
numberstringrequired
textstringrequired
showMapLocationobject
Show child attributes
latitudenumber (double)required
longitudenumber (double)required
labelstring
urlstring (uri)
createCalendarEventobject
Show child attributes
titlestringrequired
descriptionstring
startstring (date-time)
endstring (date-time)
customobject

Optional key-value bag for client-specific metadata.

Request example

cURL · cURL
curl -L -X POST "https://unifier-cpaas.sms.es/v1/messages" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-Key: <X-API-Key>" \
  --data-raw '{
  "message": {
    "msgId": "string",
    "sender": "string",
    "receiver": "string",
    "channel": "rbm",
    "validityPeriod": 0,
    "connectionCName": "string",
    "dcs": "gsm",
    "body": {
      "fileMessage": {
        "name": "string",
        "url": "string",
        "fileType": "string",
        "mimeType": "string",
        "size": 0,
        "playingLength": "string",
        "thumbnailName": "string",
        "thumbnailUrl": "string",
        "thumbnailMimeType": "string",
        "thumbnailSize": 0
      }
    },
    "custom": {}
  },
  "fallback": [
    {
      "msgId": "string",
      "sender": "string",
      "receiver": "string",
      "channel": "rbm",
      "validityPeriod": 0,
      "connectionCName": "string",
      "dcs": "gsm",
      "body": {
        "fileMessage": {
          "name": "string",
          "url": "string",
          "fileType": "string",
          "mimeType": "string",
          "size": 0,
          "playingLength": "string",
          "thumbnailName": "string",
          "thumbnailUrl": "string",
          "thumbnailMimeType": "string",
          "thumbnailSize": 0
        }
      },
      "custom": {}
    }
  ]
}'

Responses

Successful operation (message accepted for processing; implementation returns HTTP 200).

application/json
messageobject
Show child attributes
msgIdstring
channelstring

Channel identifier as returned by the API (rbm is RCS Business Messaging).

Possible values: rbm, sms, telegram, whatsApp, email, instagram, facebook
hasFallbacksboolean
smsPartsobject
Show child attributes
totalnumber
Example response
{
  "message": {
    "msgId": "string",
    "channel": "rbm",
    "hasFallbacks": true,
    "smsParts": {
      "total": 0
    }
  }
}