How to solve API error for Get chat between user and teamsApp

Shwe Sin 0 Reputation points
2023-03-03T04:41:56.8966667+00:00

Hi!
I would like to know about "Get chat between user and teamsApp" API.
GET /users/{user-id | user-principal-name}/teamwork/installedApps/{app-installation-id}/chat

https://learn.microsoft.com/en-us/graph/api/userscopeteamsappinstallation-get-chat?view=graph-rest-1.0&tabs=http
According to Document, account have already given the permission as follows image.
Before February 13 2023, thiis api work well with same request!
Does that API have any update from February 13 2023 to Current?
When I tested in Graph-Explorer, the error message "Fetching chats for other users is not allowed" is shown!
User's image

How to solve the probelm?
If you have best solution to solve this, please assist me!

Thank you!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,463 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-03-03T06:35:36.1566667+00:00

    Hi Shwe Sin,

    Thanks for reaching out!

    It is an expected behavior, when the user ID is provided.

    As you are using Graph Explorer delegated permissions, you can get the results for the logged in user only.

    But using Application permissions, we can get chats of the specified user (who may not be signed in or is different from the signed-in user) in the organization.

    Note: APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

    Hope this helps.

    If the reply is helpful, please click "Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".


  2. CarlZhao-MSFT 40,311 Reputation points
    2023-03-03T06:48:03.37+00:00

    Hi @Shwe Sin

    The /users/{user-id} endpoint is usually only supported in application context, you can try calling that in postman. Before that, you need to grant the TeamsAppInstallation.ReadForUser.All application permission to your app, and then use the Client Credentials flow to get a token.

    Let me know if you have any further questions, feel free to post back.

    Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

  3. CarlZhao-MSFT 40,311 Reputation points
    2023-03-03T07:31:17.0566667+00:00

    Hi @Shwe Sin

    I noticed that the API documentation for that endpoint was updated yesterday and I'm not sure if there are any changes to the permissions or features that apply to that endpoint.

    For this, I recommend you raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from:

    http://aad.portal.azure.com or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments