How to get chat id from conversation id

DevAsith
51
Reputation points
I'm currently developing a Teams Chat Bot application and need to access the chat history.
My plan involves obtaining the chat ID and using the Graph API to retrieve the most recent messages.
However, I've only been able to acquire the conversation ID. How can I obtain the chat ID for the message?
public async Task OnMessageActivityAsync(ITurnContext turnContext, AppState turnState, CancellationToken cancellationToken)
{
string token = turnState.Temp.AuthTokens["graph"];
var conversationReference = turnContext.Activity.GetConversationReference();
var teamsChannelId = turnContext.Activity.TeamsGetChannelId();
var teamsChannelIdws = turnContext.Activity.TeamsGetSelectedChannelId();
// how to get chat id ???
}
Sign in to answer