Send an OTT message to the recipient. Supported OTT networks are Facebook Messenger and LINE.
JSON Parameters
Name
Type
Description
messageKey
string
Required. User-defined message identifier.
messageGroupKey
string
User-defined message identifier to group a number of send requests.
from
object
Required. Object containing the senderType and senderId.
from.senderType
string
Required. Indicates the name of the OTT network the resource is being registered with values: line, messenger.
from.senderId
string
Required. Indicates the identifier of the OTT resource sending the message: LINE Channel Id, Messenger Page Id.
to
object
Required. Message Recipient details. For Messenger: Either ottId or userReference is required. If both ottId and userReference are provided, userReference is used for the send request. For LINE: ottId is required. If both ottId and userReference are provided, userReference is used for send request.
to.ottId
string
Recipient ID of the user. For LINE, if userReference is invalid, a retry is attempted with ottId as senderId.
to.userReference
string
Alternate Recipient ID of the user. For Messenger: user_ref can be passed as userReference. For LINE, reply_token can be passed as userReference.
message
object
Required. Message contents of the send request.
message.subject
string
Message name
message.contents
array
Required. Message content blocks of the send message request. For messenger, only 1 content block is allowed. For LINE, upto 5 content blocks are allowed.
message.contents.type
string
Required. Indicates the message content type of the send request with values: text, image, audio, video, native.
message.contents.text
string
Message text to be sent out to the recipient. Required for ‘text’ type message content.
message.contents.url
string
URL of the multimedia attachment to be sent out to the recipient. Required for ‘image, audio, video’ type message content.
message.contents.altUrl
string
Alternate URL of the multimedia attachment to be sent out to the recipient. Required for LINE for ‘image, video’ type message content.
message.contents.duration
string
Length of the audio multimedia attachment to be sent out to the recipient. Required for LINE for ‘audio’ type message content.
message.contents.nativePayload
object
Ott-network-specific blob of JSON payload passed in message request.
message.contents.isReusable
boolean
Indicates if a multimedia attachment can be reused for future messages. Only supported for Messenger.
message.contents.attachmentId
string
Attachment Id of a reusable multimedia asset. Only supported for Messenger.
message.customKeys
array
Custom keys to pass-through in the message payload.
message.customKeys.messagingType
string
Indicates the messaging_type of a messenger send request with values: RESPONSE, UPDATE, MESSAGE_TAG. Required for Messenger send requests.
message.customKeys.tag
string
Message Tag of a messenger send request. Required for Messenger send request if messagingType = Message_TAG.
message.customKeys.notificationType
string
Indicates the push notification type for message send request with values: REGULAR, SILENT_PUSH, NO_PUSH. Required for Messenger. Optional for Messenger send requests.
validityPeriod
string
Required. Time period for which the request is valid.
Responses
Status
Name
Type
Description
201
Created
ottRequestId
guid
The ID of the send message request which can also be used to retrieve the message send details.
400
Bad Request
message
string
Error message.
errorcode
number
Error code.
documentation
string
Documentation for the error code.
validationErrors
array
Validation errors in the request payload.
403
Forbidden
message
string
Error message.
errorcode
number
Error code.
documentation
string
Documentation for the error code.
404
Not Found
message
string
Error message.
errorcode
number
Error code.
documentation
string
Documentation for the error code.
Usage
Example Request: Messenger Message Send
For the to object, either ottId or userReference is required. If both ottId and userReference are provided, userReference is used for send request.
The message.contents array can’t contain more than 1 object.
For the message.customKeys array, messagingType is required. If the messagingType is MESSAGE_TAG, then message.customKeys.tag is required. notificationType is an optional custom key.
For the to object, ottId is required. If both ottId and userReference are provided, userReference is used for send request. If userReference is invalid, a retry is attempted with ottId as senderId.
The message.contents array can contain up to 5 content objects.
1HTTP/1.1 400 Bad Request23{4 "message": "Please fix the following errors",5 "errorcode": 10006,6 "documentation": "",7 "validationErrors": [8 {9 "message": "Message contents must be provided",10 "errorcode": 10002,11 "documentation": ""12 }13 ]14}
Possible Errors
Message
Details
From object must be provided
The send message request payload is missing a from object.
Sender Id must be provided
senderId is empty or missing in the from object in the send message request payload.
Sender Type must be provided
senderType is empty or missing in the from object in the send message request payload.
Sender Id provided is either unregistered or inactive Unknown
senderId provided in the send message request payload is unregistered or inactive Unknown.
To object must be provided
The send message request payload is missing a to object.
Message object must be provided
The send message request payload is missing a message object.
Message contents must be provided
The send message request payload is missing a contents property within message object or contents array is empty.
Content Type for all message contents must be provided
type is empty or missing in at least one of the content objects in contents property within message object.
Text attribute must be provided for Text type Message Content
text is empty or missing for a content object with type text in contents property within message object.
Url attribute must be provided for Image, File, Audio and Video type Message Content
url is empty or missing for a content object with type image, audio, video, file in contents property within message object.
Validity Period must be provided
validityPeriod is empty or missing in the from object in the send message request payload.
Message object can’t contain more than {0} message objects
contents array in message contains more objects that supported for a specific OTT network. For Messenger, contents array can’t contain more than 1 object. For LINE, contents array can’t contain more than 5 objects.
MessagingType must be provided as a Custom Key
MESSENGER only: messagingType property is empty or missing in customKeys.
Tag must be provided as a Custom Key when MessagingType is provided as MESSAGE_TAG
MESSENGER only: tag property is empty or missing in customKeys, if the messagingType is set to MESSAGE_TAG.
Either OttId or UserReference must be provided in the To object
MESSENGER only: Both ottId and userReference are empty or missing in the to object in the send message request payload. At least one of the fields should be provided.
OttId must be provided in the To object
LINE only: ottId is empty or missing in the to object in the send message request payload.
Use a native message content type to send an OTT network-specific content other than Text, Image, Audio, or Video. For Messenger, the native content type can be used to send File, Templates including Generic template, button template, receipt template, and list template. To send a native message, use a content type of native and provide the OTT network-specific message object into payload property.
Use a native message content type to send an OTT network-specific content other than Text, Image, Audio, or Video. For LINE, the native content type can be used to send Sticker, Location, ImageMap, Button Template, Confirm Template, Carousal Template and Image Carousal Template. To send a native message, use a content type of native and provide the OTT network-specific message object into payload property.