0
votes

I'm trying to write a web app on our website which gets a User's MS Team channels and then posts a message to a channel of their choosing using MS Teams Graph API.

I'm about to get an access token using the OAuth API, and I'm passing access token (AAD token) to the /me/joinedTeams endpoint, it's giving me the below error:

{ "error": { "code": "ResourceNotFound", "message": "Resource not found.", "innerError": { "date": "2021-05-14T20:57:03", "request-id": "30d80d9a-66f4-47ff-ab11-dacb7f817806", "client-request-id": "30d80d9a-66f4-47ff-ab11-dacb7f817806" } } }

Screenshot of my Graph Explorer results

UPDATE:

I have gotten my account converted to a Work account, and added the permissions. Now I am getting this response/error:

Screenshot of new Graph Explorer results

1

1 Answers

0
votes

It's better for you to share how to get an access token using the OAuth API. In this issue , it seems your signed-in user is a personal Microsoft account, that's not supported to access the /me/joinedTeams endpoint. Doc of this API.

enter image description here

There are some notes here:

  1. When using Graph Explorer, access token is here after login. You don't need to add bearer token in Request headers.

enter image description here

  1. You have to sign in with a work or school account, and you need to consent one of the required permissions in "modify permissions(Preview)".

enter image description here