1
votes

Is it possible to retrieve the ID of a personal / one-on-one chat (between two users, not between the user and a bot) from inside a message extension in an unencrypted format so that it's usable with the Graph API?

I'm pretty sure I already know the answer because why else would it be encrypted in the first place? The thing is, this is really inconsistent as you can retrieve the plain chat ID for group chats or even the plain ID of channels.

All calls to TeamsInfo or the BotFrameworkAdapter in that regard fail with Error: The bot is not part of the conversation roster. I presume they'd only work when the bot is part of the conversation (which is not possible for personal chats).

This way my message extension can't work in personal chats which wouldn't make sense to users. Anybody know a workaround?

I've had the same problem with fetching the team ID (specifically the AAD Group ID of the team) for channels (see here) which I bypassed by fetching all teams/channels of a user from the Graph API and matching based on channel ID. However, I can't find a similar workaround for personal chats as there's literally no info on the chat available other than the encrypted chat ID as far as I can tell.

2

2 Answers

0
votes

I'm pretty sure the ID is not 'encrypted', but it might be 'encoded' (i.e. follow a set algorithm) to get a unique chat id.

Either way, similar to the last answer, you can get what you need via the Graph (Beta endpoint). See the List Chats endpoint and the Get Chat Members endpoint.

0
votes

You can fetch conversationChatId for your app by using Graph API.

Steps:

  1. Get the teamsAppId for your app
  2. Determine whether your bot is currently installed for a message recipient
  3. Retrieve the conversation chatId

Please follow the steps given in the documentation and let us know if you are facing any issues.