Indra_Gheorghe | 2021-08-02 14:04:39 UTC | #1
Hi,
We are using the pure cloud JS sdk to connect our widget to the genesys chat. We need to get the name of the agent that answered the chat conversation.
We currently get the agentID(memeberid for the agnet) at the start of the conversation, however this is not the same as the genesys user id.
We are trying to use https://developer.genesys.cloud/api/rest/client-libraries/javascript/UsersApi#getUser to get the agent name however we have no way to map the member id of the agent to the genesys user id. We already tested by copying the user id from genesys and the api is working.
So: how do we get the agent name for a conversation? Do we map the member id to userid and if so how or is there any other way?
Edit: fixed confusion between memberid and agentid
Thanks
Jerome.Saint-Marc | 2021-08-02 14:00:01 UTC | #2
Hello,
What do you mean by AgentID? member.id in Guest Chat API, participantId in a conversation context (Conversations API), ... I am asking as there is no attribute named agentID.
Regards,
Indra_Gheorghe | 2021-08-02 14:03:29 UTC | #3
Jerome.Saint-Marc, post:2, topic:11643
a conversation context (Conversations API), ... I am asking as there
by agent id i mean the member id of the agent. sorry for the confusion
Jerome.Saint-Marc | 2021-08-02 14:17:43 UTC | #4
You would have to retrieve the Conversation context (Platform API -> Conversations API) using a GET /api/v2/conversations/{conversationId} to get the conversation
NB: The conversationId corresponds to the *id* attribute you get in the response to the create chat (POST /api/v2/webchat/guest/conversations)
Once you have retrieved the conversation context (using GET /api/v2/conversations/{conversationId}), you can look for participant(s) with *purpose* attribute set to "agent" (in the *participants* attribute/array). The memberId will appear in the *chats* array of a participant - it corresponds to the *id* of a chat (so you can select/find the right agent if multiple agents participated to the chat conversation). The *userId* will be available in the participant object (that you can then leverage in the Users API to get the user). Note that the *name* of the agent also appears in the participant structure (if this is all you need).
Regards,
system | 2021-09-02 14:18:02 UTC | #5
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: 11643