question

KeffelerMiclain-7317 avatar image
0 Votes"
KeffelerMiclain-7317 asked KeffelerMiclain-7317 commented

Graph API List Channel Messages Returnng UnknownError after Protected API Request Approved

I am unable to get a good response, and having hard time finding Docs. Can't find a way to lookup the inner error code at all either. I get a token using curl -L -X POST 'https://login.microsoftonline.com/51bcb6e4-b738-4e87-a795-768e3f13b94f/oauth2/v2.0/token' \ -H 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'client_id=5bbd5786-31d3-4d84-a8d0-a0dac6522f93' \ --data-urlencode 'scope=https://graph.microsoft.com/.default' \ --data-urlencode 'client_secret=<secret>' \ --data-urlencode 'grant_type=client_credentials' and then take the access_token value, and do this curl -L -X GET 'https://graph.microsoft.com/v1.0/teams/d89133ea-bf32-4957-8300-aa5e083f45c1/channels/19:5b075a993aee4b3fa8f23be2cbb3b514@thread.skype/messages' \ -H 'Authorization: Bearer <token value from above>' But I get this error 403: { "error": { "code": "UnknownError", "message": "", "innerError": { "date": "2021-03-09T19:15:23", "request-id": "c9a8cf3a-b914-44a8-a66a-506634f09d77", "client-request-id": "c9a8cf3a-b914-44a8-a66a-506634f09d77" } } } how can I troubleshoot? the url for the GET seems right, based on all my research. we are using resource specific consent permissions, but the app is installed in the channel that I am trying to list messages. from

office-teams-app-devmicrosoft-graph-teamworkmicrosoft-graph-applications
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Adding right tags/teams to assist.

0 Votes 0 ·
  • I see that you're doing curl. Outside of your application you can repro the issue (with graph explorer or postman) as well?

  • Starting when you're seeing the issue.?

0 Votes 0 ·

i exported the curls from postman, so yeah im reproducing it with postman still right now

0 Votes 0 ·

also weird, I get the same error


{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "date": "2021-03-17T15:58:12",
            "request-id": "9a567a4b-ed3a-4b6c-92c6-228a4a1d8a86",
            "client-request-id": "9a567a4b-ed3a-4b6c-92c6-228a4a1d8a86"
        }
    }
}


when I use the graph explorer myself, to list channel messages from the same channel. I have access to view this channel through teams already, so not sure why that would be.

0 Votes 0 ·
Mamatha-MSFT avatar image
0 Votes"
Mamatha-MSFT answered KeffelerMiclain-7317 commented

@KeffelerMiclain-7317 Can you please confirm have you added RSC permissions in your manifest and to list channel messages you need to add ChannelMessage.Read.All permission.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Screenshot below confirming i have the permission, I believe I just use the .default scope, and it is supposed to grant that for my token.


Additionally, find a screenshot showing that my app did request and obtain the RSC permission on the team/team channel that I am trying to read messages from, as can be seen by listing permissionGrants. Additionally I attached a screenshot confirming the app ID of the app in the portal is the same listed when I list permissionGrants.80282-2021-03-22-09-23-10.png80274-2021-03-22-09-23-36.png

80227-2021-03-22-09-15-05.png


0 Votes 0 ·
Mamatha-MSFT avatar image Mamatha-MSFT KeffelerMiclain-7317 ·

@KeffelerMiclain-7317 Are you facing this issue in Postman as well.

0 Votes 0 ·

Yes, the curl commands I shared were exported from postman. I am reproducing in postman.

0 Votes 0 ·
KeffelerMiclain-7317 avatar image
0 Votes"
KeffelerMiclain-7317 answered KeffelerMiclain-7317 commented

I am trying to rule out issues. I added the Channel.ReadBasic.All permission in azure, see screenshot.

Then, I authenticated and tried this call to list channels in a team

GET https://graph.microsoft.com/v1.0/teams/af746e47-d762-4574-b0eb-e966db88d7d1/channels

and got back

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "date": "2021-03-23T13:56:54",
            "request-id": "e92fb816-b37f-467c-8dc6-2feb406784e7",
            "client-request-id": "e92fb816-b37f-467c-8dc6-2feb406784e7"
        }
    }
}



I am trying to rule out a larger graph api issue for this client, as opposed to this one thing. not sure if this is helpful.80753-2021-03-23-08-57-55.png



· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is there a faster way to get support? we are an enterprise customer and have been troubleshooting for almost 2 weeks.

0 Votes 0 ·
Mamatha-MSFT avatar image Mamatha-MSFT KeffelerMiclain-7317 ·

@KeffelerMiclain-7317 To list channel please provide these permissions
ChannelSettings.Read.Group*, ChannelSettings.ReadWrite.Group*, Channel.ReadBasic.All, ChannelSettings.Read.All, ChannelSettings.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All.

And for List channel messages I am unable to repro the issue, It is working fine. Taking this for internal discussion with team, I will update you with resolution.


0 Votes 0 ·
Mamatha-MSFT avatar image Mamatha-MSFT KeffelerMiclain-7317 ·

@KeffelerMiclain-7317 - Please check the roles for your access token in https://jwt.io/ and check in the response whether all the assigned permissions are displaying or not.
81487-image.png


0 Votes 0 ·
image.png (16.1 KiB)

81578-2021-03-25-09-26-38.png


no roles listed

0 Votes 0 ·
Show more comments