User ID as email id is not working for chat history API

In chat history, we are supposed to pass the user id, So I am passing my mail id in Chat history API call. In Websdk, passing the same email id as user identity.

But I am not able to fetch the history for the Bot. When I debugged it on platform, I found that user id might be in format of u-b172b614-f19d-53fa-a30a-bf2b4c39ac48. How do we get this user id on the platform?

What is the difference between Kore User ID and Channel User ID?

Hello @praful_dhone

Thank you for contacting Kore.

An email ID will be recorded as channel ID in kore platform. For API calls we use user id and not channel id. You will be able to find the channel ID from Bot builder in Metrics page.

Analyze>> Metrics >> Change User ID to Kore user ID


Let us know if this helps.

Thanks Sameera for replying. :slight_smile:

But how can I pass this Kore User ID to History API that I am calling from the platform?

My requirement is: I want to raise a case in Salesforce with the chat history. I am good at raising the case but wanted to fetch the chat history for that particular user. Now on Web SDK part, I only have Channel User ID which I am passing as email id. And based on email id, I am not able to fetch the history. How to tackle with this situation?

How can I get the Chat History for particular session id? Do I need to pass “conversationSessionId” value to https://{{host-ip}}/api/public/bot/{{bot-id}}/getMessages?userId={{user-id}}&sessionId={{conversationSessionId}} or something else? I want to get the chat history for current session on the platform. When I am saying on platform, I will call this API in Service node and extract the history from API. Is there any context variable available where I can get this history without calling API?

Hello @praful_dhone,

Yes. If session Id is known you can use if to filter data for a particular session.

You can find session via Session History API