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.
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.
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).