Venu Kishore
Venu Kishore

Reputation: 21

I'm unable to Send chatMessage in a channel or a chat using Microsoft Graph API

I was just trying to access the Send chatMessage in a channel or a chat using the microsoft grah API. Also given the required permissions for the for my application both Delegant & Application level.

API Used : POST https://graph.microsoft.com/v1.0/teams/fbe2bf47-16c8-47cf-b4a5-4b9b187c508b/channels/19:[email protected]/messages

Content-type: application/json

{

"body": { "content": "Hello World" }

}

Postman Response: 401

{

"error": {

    "code": "Unauthorized",

    "message": "Unauthorized",

    "innerError": {

        "date": "2021-07-16T16:34:49",

        "request-id": "ddd9c7ad-f84b-423f-88fc-630330bad600",

        "client-request-id": "ddd9c7ad-f84b-423f-88fc-630330bad600"

    }

}

}

Graph API Explorer Response : 403

Documentation URL : https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

Thanks in Advance.

Upvotes: 2

Views: 629

Answers (1)

Ansuman Bal
Ansuman Bal

Reputation: 11431

I tried this using graph explorer and I was able to send the message.

enter image description here

enter image description here

Note : Please make sure you have the above required permissions to send the message to the channel.

enter image description here

Reference:

Send chatMessage in a channel or a chat - Microsoft Graph v1.0 | Microsoft Docs

Upvotes: -1

Related Questions