MuleSoft Connector for Salesforce Marketing Cloud

Build 20.0.7654

SendMessageToRecipient

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

MessageContents

You cannot send an OTT message to the recipient without specifying the content of the message. To create message contents, you must insert data in a temporary table called 'MessageContents#TEMP'. The columns available for this temporary table are the following:

ColumnDescription
TypeIndicates the message content type of the send request with values: text, image, audio, video, native.
TextMessage text to be sent out to the recipient. Required for 'text' type message content.
UrlURL of the multimedia attachment to be sent out to the recipient. Required for 'image, audio, video' type message content.
AltUrlAlternate URL of the multimedia attachment to be sent out to the recipient. Required for LINE for 'image, video' type message content.
DurationLength of the audio multimedia attachment to be sent out to the recipient. Required for LINE for 'audio' type message content.
NativePayloadOtt-network-specific blob of JSON payload passed in message request.
IsReusableIndicates if a multimedia attachment can be reused for future messages. Only supported for Messenger.
AttachmentIdAttachment Id of a reusable multimedia asset. Only supported for Messenger.

MessageCustomKeys

You can also specify message custom keys to pass-through in the message payload by inserting data in a temporary table called 'MessageCustomKeys#TEMP'. The columns available for this temporary table are the following:

ColumnDescription
messagingTypeIndicates the messaging_type of a messenger send request with values: RESPONSE, UPDATE, MESSAGE_TAG. Required for Messenger send requests.
tagMessage Tag of a messenger send request. Required for Messenger send request if messagingType = Message_TAG.
notificationTypeIndicates the push notification type for message send request with values: REGULAR, SILENT_PUSH, NO_PUSH. Required for Messenger. Optional for Messenger send requests.

Execute

Messenger message send:

Insert INTO MessageContents#Temp(type,text) Values('text','thanks for purchase')
Insert INTO MessageCustomKeys#Temp(messagingType) Values('RESPONSE')
EXECUTE SendMessageToRecipient MessageKey='e1c35141-6e5c-4bc2-813b-60f969e52b0d', MessageGroupKey='CanBeAGUIDorAny100UnicodeCharString', SenderType='messenger', SenderId='503868699681937', OttId='FBfacdb735074f7c492c0bf190fa99020', UserReference='1938cd4d34cc4db0b109756b8a9b14ff', Subject='Message Name', ValidityPeriod=30"

Different Messenger Content Types:

Insert INTO MessageContents#Temp(type,url,AltUrl,IsReusable,AttachmentId) Values('image','https://example.com/original.jpg','https://example.com/preview.jpg',true,12345)
Insert INTO MessageCustomKeys#Temp(messagingType) Values('RESPONSE')
EXECUTE SendMessageToRecipient MessageKey='e1c35141-6e5c-4bc2-813b-60f969e52b0d', MessageGroupKey='CanBeAGUIDorAny100UnicodeCharString', SenderType='messenger', SenderId='503868699681937', OttId='FBfacdb735074f7c492c0bf190fa99020', UserReference='1938cd4d34cc4db0b109756b8a9b14ff', Subject='Message Name', ValidityPeriod=30"

LINE message send:

Insert INTO MessageContents#Temp(type,text) Values('text','thanks for purchase')
Insert INTO MessageCustomKeys#Temp(messagingType) Values('RESPONSE')
EXECUTE SendMessageToRecipient MessageKey='CanBeAGUIDorAny100UnicodeCharString', MessageGroupKey='CanBeAGUIDorAny100UnicodeCharString', SenderType='line', SenderId='2145435435632435', OttId='U42348yafsd8y3248yfsq8cy9088934d', UserReference='1938cd4d34cc4db0b109756b8a9b14ff', Subject='Message Name', ValidityPeriod=30"

Input

Name Type Required Description
MessageKey String True User-defined message identifier.
MessageGroupKey String False User-defined message identifier to group a number of send requests.
SenderType String True Indicates the name of the OTT network the resource is being registered with values: line, messenger.
SenderId String True Indicates the identifier of the OTT resource sending the message: LINE Channel Id, Messenger Page Id.
OttId String True Recipient ID of the user. For LINE, if userReference is invalid, a retry is attempted with ottId as senderId.
UserReference String True Alternate Recipient ID of the user. For Messenger: user_ref can be passed as userReference. For LINE, reply_token can be passed as userReference.
Subject String False Message name.
ValidityPeriod Integer True Time period for which the request is valid.

Result Set Columns

Name Type Description
OttRequestId String The request ID of the OTT.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7654