Issue with running GET command within Graph Explorer

Paul Wright 1 Reputation point
2021-08-23T15:30:22.593+00:00

I have been tasked to retrieve bulk chat messages from a particular user within Teams in the chat and channel areas.

I am using Graph Explorer. I am getting an error when running the following query: https://graph.microsoft.com/beta/users/Zolla@zolla75.onmicrosoft.com/chats/getAllMessages

    "code": "PreconditionFailed",  
            "message": "Requested API is not supported in delegated context",  

I have setup App permissions within AAD and provided the correct permissions to run the query.

I am able to run other queries like https://graph.microsoft.com/beta/teams/9708524d-c201-4eeb-854e-502637eef170/channels/19%3a-7Nu-mc2pLJ1l__mRaqtR8proR48zHm6OXOt0CDDydI1%40thread.tacv2/messages - this returns the correct info so I therefore believe my app permissions are configured correctly within AAD. I double checked the permission.

125685-image.png

I am very new to this so any guidance would be appreciated.

Thanks

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

3 answers

Sort by: Most helpful
  1. Jake 6 Reputation points
    2021-08-25T06:32:06.787+00:00

    The getAllMessages endpoint is a protected API did you request access? export-teams-content

    Prerequisites to access Teams Export APIs

    Teams Export APIs are currently in preview. It will only be available to users and tenants that have the required licenses for APIs. In the future, Microsoft may require you or your customers to pay additional fees based on the amount of data accessed through the API.

    Microsoft Teams APIs in Microsoft Graph that access sensitive data are considered protected APIs. Export APIs require that you have additional validation, beyond permissions and consent, before you can use them. To request access to these protected APIs, complete the request form.

    Application permissions are used by apps that run without a signed-in user present; application permissions can only be consented by an administrator. The following permissions are needed:

    Chat.Read.All: enables access to all 1:1, Group chat, and meeting chat messages
    ChannelMessage.Read.All: enables access to all channel messages
    User.Read.All: enables access to the list of users for a tenant


  2. Paul Wright 1 Reputation point
    2021-08-25T09:41:14.75+00:00

    Hi there

    Thanks very much for the reply. I haven't requested access so will run through this first. I guess these are in preview too at the moment.

    Will have to check how to request access.

    Cheers


  3. Paul Wright 1 Reputation point
    2021-12-17T11:24:36.597+00:00

    Hi,

    When I do a search for the Chat.Read.All permission within graph explorer, nothing displays.
    158508-image.png

    Any ideas as to why this doesn't display?

    0 comments No comments