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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,397 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,056 questions
{count} votes

Accepted answer
  1. 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.


1 additional answer

Sort by: Most helpful
  1. Vasil Michev 100.1K Reputation points MVP
    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.