Authentication errors when sending messages to Teams

Keita Yamashiro 61 Reputation points
2021-09-28T08:24:41.683+00:00

The API is used in the following process.

  1. get token
  2. send a message to Teams using the obtained token

However, after you change the password of your Microsoft account, you will not be able to send messages to Teams.
You can get a token or update it with a refresh token.

The following APIs will generate error Unauthorized.

https://graph.microsoft.com/v1.0/teams/{team_id}/channels/{channel_id}/messages

If I change the password of my Microsoft account, will I not be able to use the Teams API?
I would appreciate it if someone could tell me.

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

Microsoft Security | Microsoft Graph

Answer accepted by question author

Ramjot Singh 861 Reputation points Microsoft Employee
2021-09-28T15:58:02.073+00:00

We are tracking an issue where changing password can result into it taking a long time to get access to the API again (upto 1 day). For now if you wait for a day you should get access to the API again.

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Vasil Michev 127.3K Reputation points MVP Volunteer Moderator
    2021-09-28T09:21:35.693+00:00

    Microsoft (personal) accounts are not supported for that endpoint, as documented here: https://learn.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http
    You need to use a work/Office 365 account. Other than that, make sure you have the required permissions.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.