apifycloud | 2022-10-09 17:40:52 UTC | #1
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"}} }
Matt_Faulkner | 2022-10-10 14:46:03 UTC | #2
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) )
system | 2022-12-05 14:13:42 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 16645