Social message find toParticipant

Hi!

I am getting the social messages, like FB, using GET https://api.{{environment}}/api/v2/conversations/messages/:conversationId endpoint that contains the fromAddress and toAddress fields. I tried to find the exact participant the messages were sent, but the toAddress contains the same value for all participant, where purpose is agent, so this did not work out.

How can I find the exact participantId, participant a message was sent to?

@Vereb_Laszlo This page might help you some https://developer.genesys.cloud/commdigital/digital/recipients/ For all the "internal" (Genesys Cloud) messages, you are going to see the same fromAddress and toAddress values. Because the end customer sends a message "to" the FB Integration. The Integration is then responding back to the customer through various participants (workflow, acd, agent, etc) on the conversation.
The participantId of each agent ("purpose":"agent"), would contain a userId that helps to figure out which agent it is that is responding. The id in that participants array is the participantId.
Let me know if this doesn't solve your exact question.

Thanks, that link cleared up things.
Still, how can we know which participant answered? Simply the participant, which sent the next message?
Or is there a more direct connection?

@Vereb_Laszlo I'm not sure I am following your question here exactly. But since there is a possibility for many different "internal" Genesys Cloud participants on a given Conversation. There is also the possibility that each of those, could have responded to the end customer participant with message(s), at some point in that Conversation's life cycle.
For instance with an inbound message from the end customer. The workflow participant could reply back to the customer (if your Architect flow is configured for that). It could then route the message to an acd participant (queue), which could have an In Queue flow that also sends messages out. Then routes to an available agent participant that doesn't answer, so the the queue eventually routes to another agent that maybe does answer, etc. As you can see there are many possibilities, depending on your configurations.
In general if you look at each participants[].messages[].messages[] arrays you will see the ones that sent messages. The final messages[] array there, would be empty array, if that participant never sent any messages.

In our setup, we need both from AND to participants for each message, but the responses only contain the from participant, and would like to find the to participant.
So if I understand, there is no forward reference to the next participant, and there is no backward reference to the previous participant. Solution, is that I sort the participant[].<mediaType>[].messages[], by timestamp, and use the next message's from participant as the current message's to participant.

@Vereb_Laszlo the participants[].messages[].peerId field should help you there. It helps tie back that participant's message with the one that "initiated" it. It's a reference to the initiating participant participants[].messages[].id field.
Also as you said, timestamps can help you as well, but i think peerId gets you closer to what you are looking for.

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