I am trying to access microsoft graph api to send message to a channel in a team. I am using this endpoint https://graph.microsoft.com/beta/teams/{team_id}/channels/{channel_id}/messages. getting 403 forbidden error

Simran Panjwani 20 Reputation points
2024-03-27T07:45:49.6366667+00:00

I am trying to access microsoft graph api to send message to a channel in a team. I am using this endpoint https://graph.microsoft.com/beta/teams/{team_id}/channels/{channel_id}/messages.

I have already granted all the API permissions in AAD. I have granted Teamwork.Migrate.All as a application permission in my AAD. User's image

however, i am getting this error

 "code": "Forbidden",
        "message": "Missing role permissions on the request. API requires one of 'Teamwork.Migrate.All'. Roles on the request ''.",

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,075 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 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.
2,846 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,474 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 36,976 Reputation points
    2024-03-27T08:37:31.9433333+00:00

    Hi @Simran Panjwani

    Application permissions are only supported for migration. If you are not importing third-party messages into a team channel that is in a migrated state, do not use application permissions but instead use delegated permissions. Note that don't forget to grant administrator consent after granting permissions to the calling app.

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful