0
votes

I'm creating an application "valid-microsoftgraph" on "App registrations" in "Azure Active Directory" to connect to graph api using msal written by python . And, I'm using "Client secrets" to connect between msal and "valid-microsoft graph". And, be granting following permissions of "valid-microsoft graph".

  • API/Permissions name: Team.ReadBasic.All, type: Application, Status: granted for admin
  • API/Permissions name: TeamsActivity.Read.All, type: Application, Status: granted for admin
  • API/Permissions name: Channel.ReadBasic.All, type: Application, Status: granted for admin
  • API/Permissions name: ChannelMessage.Read.All, type: Application, Status: granted for admin

I want to execute the following get request for "valid-microsoft graph", but it returns "Unknown Error".

Make sure that you have entered the ids that definitely exist for "teams_id" and "channel_id". (I retrieved "teams_id" from "users/{user_id}/joinedTeams") (I retrieved "channel_id" from "teams/{id}/channels")

I'm in trouble because I don't understand why I can't get ChannelMessage, so I'd be very happy if you could help me. Thank you.

1
(1) What type of flow you're using - delegated or application permission? (2) When you're getting the error - after receiving the Access token from Identity or when you try to access the graph resource using the acquired token? (3) cross check the permissions that you configured in Azure AD portal (4) Validate the token in jwt.ms and see you have the valid scope (5) Try to repro the issue with MS Graph Explorer or POSTMAN and see if it works for you (6) Share the request id, timestamp of the above detailed error stack that you get... - Dev
You can subscribe to the ChatMessage API using change notification API, Later on you can read the channel messages - Trinetra-MSFT

1 Answers

0
votes

Its late but answer might help someone

This is because certain API's in Microsoft Graph are Protected API's. Particularly certain API's related to teams. This is keeping in consideration user's privacy, else every chat message and organizations IP might be at risk

Here is the documentation about protected API's - https://docs.microsoft.com/en-us/graph/teams-protected-apis

If you want to access these protected API's you have to fill this form mentioned on Microsoft documentation stating detailed purpose - https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR1ax4zKyZjVBmutzKVo1pVtUQ1VJMlNTNUdJV1FKTzVZSVU4MlMwTTdOTSQlQCN0PWcu