POST /ott/v1/send

Send an OTT message to the recipient. Supported OTT networks are Facebook Messenger and LINE.

NameTypeDescription
messageKeystringRequired. User-defined message identifier.
messageGroupKeystringUser-defined message identifier to group a number of send requests.
fromobjectRequired. Object containing the senderType and senderId.
from.senderTypestringRequired. Indicates the name of the OTT network the resource is being registered with values: line, messenger.
from.senderIdstringRequired. Indicates the identifier of the OTT resource sending the message: LINE Channel Id, Messenger Page Id.
toobjectRequired. 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.ottIdstringRecipient ID of the user. For LINE, if userReference is invalid, a retry is attempted with ottId as senderId.
to.userReferencestringAlternate Recipient ID of the user. For Messenger: user_ref can be passed as userReference. For LINE, reply_token can be passed as userReference.
messageobjectRequired. Message contents of the send request.
message.subjectstringMessage name
message.contentsarrayRequired. 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.typestringRequired. Indicates the message content type of the send request with values: text, image, audio, video, native.
message.contents.textstringMessage text to be sent out to the recipient. Required for 'text' type message content.
message.contents.urlstringURL of the multimedia attachment to be sent out to the recipient. Required for 'image, audio, video' type message content.
message.contents.altUrlstringAlternate URL of the multimedia attachment to be sent out to the recipient. Required for LINE for 'image, video' type message content.
message.contents.durationstringLength of the audio multimedia attachment to be sent out to the recipient. Required for LINE for 'audio' type message content.
message.contents.nativePayloadobjectOtt-network-specific blob of JSON payload passed in message request.
message.contents.isReusablebooleanIndicates if a multimedia attachment can be reused for future messages. Only supported for Messenger.
message.contents.attachmentIdstringAttachment Id of a reusable multimedia asset. Only supported for Messenger.
message.customKeysarrayCustom keys to pass-through in the message payload.
message.customKeys.messagingTypestringIndicates the messaging_type of a messenger send request with values: RESPONSE, UPDATE, MESSAGE_TAG. Required for Messenger send requests.
message.customKeys.tagstringMessage Tag of a messenger send request. Required for Messenger send request if messagingType = Message_TAG.
message.customKeys.notificationTypestringIndicates the push notification type for message send request with values: REGULAR, SILENT_PUSH, NO_PUSH. Required for Messenger. Optional for Messenger send requests.
validityPeriodstringRequired. Time period for which the request is valid. This field is not yet supported.
StatusNameTypeDescription
201  Created
 ottRequestIdguidThe ID of the send message request which can also be used to retrieve the message send details.
    
400  Bad Request
 messagestringError message.
 errorcodenumberError code.
 documentationstringDocumentation for the error code.
 validationErrorsarrayValidation errors in the request payload.
    
403  Forbidden
 messagestringError message.
 errorcodenumberError code.
 documentationstringDocumentation for the error code.
    
404  Not Found
 messagestringError message.
 errorcodenumberError code.
 documentationstringDocumentation for the error code.
  • 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.
MessageDetails
From object must be providedThe send message request payload is missing a from object.
Sender Id must be providedsenderId is empty or missing in the from object in the send message request payload.
Sender Type must be providedsenderType is empty or missing in the from object in the send message request payload.
Sender Id provided is either unregistered or inactive UnknownsenderId provided in the send message request payload is unregistered or inactive Unknown.
To object must be providedThe send message request payload is missing a to object.
Message object must be providedThe send message request payload is missing a message object.
Message contents must be providedThe 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 providedtype 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 Contenttext 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 Contenturl is empty or missing for a content object with type image, audio, video, file in contents property within message object.
Validity Period must be providedvalidityPeriod is empty or missing in the from object in the send message request payload.
Message object cannot contain more than {0} message objectscontents 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 KeyMESSENGER only: messagingType property is empty or missing in customKeys.
Tag must be provided as a Custom Key when MessagingType is provided as MESSAGE_TAGMESSENGER 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 objectMESSENGER 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 objectLINE 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.

For more information about Messenger sends, see the Facebook Messenger Send API Reference.

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.

For more information about LINE sends, see the LINE API Reference.