Forum Discussion

jellyfishninja999's avatar
jellyfishninja999
Copper Contributor
May 03, 2024

Send a message via chat through Postman

TL;DR - Receiving error message when trying to send a message in Teams via Postman even though all permissions are assigned.

Hi,

I am trying to work a use case where I need to send a message to an individual user via Postman where we break this down into several steps:
1. Get the user id of the sender and recipient.
2. Create a chat id between the sender and the recipient.
3. Send a message from the sender to the recipient.

I was able to get to the first two steps done via Postman but the 3rd step where we need to send a message; I'm getting an error stating that:

"message": "Message POST is allowed in application-only context only for import purposes. Refer to https://docs.microsoft.com/microsoftteams/platform/graph-api/import-messages/import-external-messages-to-teams for more details.

I did some research and understood that I need to assign delegated permissions in order to send a message since delegated permissions can represent as a user which makes sense. Issue is even after assigning the permissions (Least and High Privileged); I'm still getting the same message. I'm attaching a screenshot of permissions assigned to my app below:


And below are the permissions mentioned in the document:


References:
1. https://learn.microsoft.com/en-us/graph/api/chat-post-messages?view=graph-rest-1.0&tabs=http
2. https://learn.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-1.0&tabs=http

3. https://learn.microsoft.com/en-us/graph/use-postman

4. https://learn.microsoft.com/en-us/graph/use-postman-with-delegated-authentication


 

  

No RepliesBe the first to reply

Resources