Custom Attributes for Open Messaging

What is the correct way to get participant data in architect for Open Messaging?

Previously we did this using Guest chat API using a expression like this:

Chat.Guest.customFields[0].value

How can i get custom attrivutes sent for inbound open messaging like this:

class OpenNormalizedMessage {
id: null
channel: class OpenMessagingChannel {
id: null
platform: null
type: Private
messageId: 39bb01b5-d833-4a87-bfa1-be5af0386fba
to: class OpenMessagingToRecipient {
nickname: null
id: e52dc91b-c4a6-464e-a0f1-83f809171265
idType: null
firstName: null
lastName: null
image: null
email: null
}
from: class OpenMessagingFromRecipient {
nickname: +919811957317
id: 919811957317
idType: Phone
firstName: null
lastName: null
image: null
email: null
}
time: Sun Oct 09 16:57:13 UTC 2022
metadata: null
}
type: Text
text: Ingreso Cedula,1231231 MenuPrincipal,1 OpenMessagingTest
content: []
status: null
reasons: []
isFinalReceipt: null
direction: Inbound
metadata: {customAttributes={"queuename":"OpenMessagingTest"}}
}

From your question it sounds like you're using the SDK. Please set the setCustomAttributes of the ChannelMetadata in the Channel Object.

Here's some sample pseudo code:

Map<String, String> channelMetaDataMap = new HashMap<>();
channelMetaDataMap.put("attribute1", "value1");
channelMetaDataMap.put("attribute2", "value2");
ChannelMetadata channelMetadata = new ChannelMetadata();
channelMetadata.setCustomAttributes(channelMetaDataMap);

var openNormalizeMessage = new OpenNormalizedMessage()
	.channel(new OpenMessagingChannel()
				.messageId(UUID.randomUUID().toString())
				.time(new Date())
	        	.to(new OpenMessagingToRecipient().id(integration))
	        	.from(new OpenMessagingFromRecipient().id(inboundFrom))
	        	.metadata(channelMetadata)
	)
1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.