1

When I attempt to use teams beta endpoints such as

https://graph.microsoft.com/beta/teams/{group-id}

with application only access I receive the error:

{
    "error": {
        "code": "InvalidRequest",
        "message": "Calling this API using MSGraph Application Permissions is not supported.",
        "innerError": {
            "request-id": "32ea3e82-d0c5-42ce-9e94-b215bf255a0a",
            "date": "2018-08-20T20:52:12"
        }
    }
}

These endpoints work fine with user delegated permissions. Is this type of access truly not supported, or am I missing something in the request? My end goal is to query teams channel messages without user interaction.


Updating with additional details on getting token and other endpoints:

I am getting consent with https://login.microsoftonline.com/{tenant}/adminconsent, then getting the token with https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token. I am using the Client Credentials grant type.

If I try to navigate deeper into the teams endpoint (e.g. channels or messages), I get:

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "request-id": "953fd07b-6e4e-4ce2-bd97-92a9eaa676bf",
            "date": "2018-08-22T13:37:08"
        }
    } 
}

I also tried https://graph.microsoft.com/beta/groups/{group-id}/, which returns expected results, but https://graph.microsoft.com/beta/groups/{group-id}/team returns the Calling this API using MSGraph Application Permissions is not supported error.

Aaron A
  • 68
  • 7

1 Answers1

0

According to your description, I suppose you want to query teams channel messages.

Following this documentation, we can retrieve the list of messages in the channel of the team.

we need the delegated permissions like Group.Read.All and Group.ReadWrite.All for the work or school account. The Application permissions is not supported.

If we want query teams channel messages without user interaction, we can use Get access without a user to get an access token.

Then we can use access token to query teams channel message without user interaction.

For more detail about how to get an access token without a user, we can review this question.

Keen Jin
  • 1,060
  • 1
  • 6
  • 8
  • I followed the documentation on access without user interaction by getting admin consent. I also verified that the appropriate permissions were granted. The error above was the result. I am able to access other endpoints without user interaction, but teams endpoints are not working. Is access to teams API without user interaction not available? – Aaron A Aug 21 '18 at 14:05
  • I think he can apply to the team endpoint, can you provide more detailed response information? – Keen Jin Aug 22 '18 at 08:05
  • That is the only response I get. I am getting consent with https://login.microsoftonline.com/{tenant}/adminconsent , then getting the token with https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token . I am using the Client Credentials grant type. If I try to navigate deeper into the teams endpoint (e.g. channels or messages), I get: { "error": { "code": "UnknownError", "message": "", "innerError": { "request-id": "e8948429-4518-4a51-bca1-a142bdced3fd", "date": "2018-08-22T13:24:36" } } } – Aaron A Aug 22 '18 at 13:27
  • I reviewed the content and the comment we posted, and I carefully read [ this document](https://developer.microsoft.com/zh-cn/graph/docs/api-reference/beta/api/channel_list_messages), and found that it does not support the Application Permissions – Keen Jin Aug 27 '18 at 01:36