Send a message via chat through Postman

Copper Contributor

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-message... 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:

jellyfishninja999_0-1714724132026.png


And below are the permissions mentioned in the document:

jellyfishninja999_1-1714724217590.png


References:
1. Send message in a chat - Microsoft Graph v1.0 | Microsoft Learn
2. Create chat - Microsoft Graph v1.0 | Microsoft Learn

3. Use Postman with the Microsoft Graph API - Microsoft Graph | Microsoft Learn

4. Use delegated authentication with Postman for Microsoft Graph - Microsoft Graph | Microsoft Learn


 

  

0 Replies