How do I use the Messaging Manager node?

The following image shows a sample flow with the Messaging Manager node.

The sample payload format for Create action

//currentUserId is the sender User ID var currentUserId = "<senderUserId>"; msg.payload = {session:{user:{currentUserId : currentUserId}}}; msg.payload.recipient = "<recipient1>, <recipient2>"; return msg;

The sample payload format for Update action

//currentUserId is the sender User ID var currentUserId = "<senderUserId>"; msg.payload.conversationId = "<targetConversationId>"; msg.payload = {session:{user:{currentUserId : currentUserId}}}; return msg;

Output

The output of this node is available under msg.payload.conversationData for post-processing the response.

In the previous example, when you trigger the intent, a custom message is sent to the recipient’s engage inbox from your login.

When you change the action to Update, the updated message is sent to the recipient.

When the action is set to Read, the node retrieves the most recent specified number of conversations.

From the output payload, you can find the read status of a message. For example:

  • msg.payload.conversationData.conversations[#].users[#].read” will have the status as “true” or “false” suggesting the message is “read by the recipient” or “not read by the recipient” respectively.

  • # is the number that depends on the Limit number. If the Limit number is 10, then # can take values between 0 and 9.

Related Articles