Hello Sneha Zagade.
Thanks for reaching out!
Using Microsoft Graph API, to get notifications when new mail is received, you can use subscriptions. A subscription allows a client app to receive change notifications about changes to data in Microsoft Graph. Please refer to the documentation for more details.
You can create subscription to receive notifications of mails using the below sample endpoint:
POST https://graph.microsoft.com/v1.0/subscriptions
Content-type: application/json
{
"changeType": "created",
"notificationUrl": "https://webhook.azurewebsites.net/api/send/myNotifyClient",
"resource": "me/messages",
"expirationDateTime":"2016-11-20T18:23:45.9356913Z",
"clientState": "secretClientValue",
"latestSupportedTlsVersion": "v1_2"
}
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".