Hi @Akansha Lalwani
Teams tag is mainly focused on the general issue of Microsoft Teams troubleshooting. According to your description, your question is not in our support scope. Thanks for your understanding and patience.
The following suggestion is for your reference:
To receive notifications only for messages sent by a user, you can use the filtering capabilities of the Microsoft Graph API. The Microsoft Graph API itself does not have direct filters to distinguish between sent and received messages, but you can filter messages by using the $filter query parameter:
- Using the $filter query parameter: For example, you can filter the from property to get only messages sent by a specific user.
- Processing the notification: After receiving the notification, process it in your application to filter out the received messages and keep only the sent messages.
- Using Microsoft Graph Change Notifications: Subscribe to Microsoft Graph's change notifications and use filters to receive only notifications for specific types of messages.
Here is an example of how to use the $filter query parameter to filter messages:
GET https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq 'user@example.com'
You can refer to the examples in the Microsoft Graph documentation to set up and use change notifications and get more help.
https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http
https://learn.microsoft.com/en-us/graph/teams-messaging-overview
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.