How to identify oneonone chats with no topic

Andrew Kennard 136 Reputation points
2023-10-04T11:29:28.2766667+00:00

Hi

I am just starting with the MSGraph API

I have made a call to get a list of the chats for a user

Some have a topic element so I can see what they are

But the ones that are oneonone don't have a topic

I can see other user Ids are part of the chat id and webURL

I'm presuming I don't have to process these strings to find the ID of the other user?

So how can I tell which chat is which

I must be missing something obvious

Thanks

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,065 questions
{count} votes

Accepted answer
  1. Nivedipa-MSFT 2,896 Reputation points Microsoft Vendor
    2023-10-05T12:32:47.0666667+00:00

    @Andrew Kennard -

    To identify one-on-one chats, you can use the chat id which is unique for each chat. However, to get more information about the chat, such as the participants, you can use the 'List Members of Chat' API. This API returns the list of all members in a chat, which can help you identify one-on-one chats.

    Here's an example of how you can use this API:

    GET /chats/{chat-id}/members

    This will return a list of chat members, which includes the user IDs of the participants. For one-on-one chats, this list should contain two user IDs - yours and the other participant's.

    Please note that you need to have the appropriate permissions to use this API. Specifically, you need one of the following permissions: Chat.ReadBasic.All, Chat.Read.All, Chat.ReadWrite.All.

    Ref Doc: https://docs.microsoft.com/en-us/graph/api/chat-list-members?view=graph-rest-beta&tabs=http

    Thanks,

    Nivedipa


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments

0 additional answers

Sort by: Most helpful