Getting error Resource not found for the segment while using Mailsend Graph API

Dinesh Kumar Putla 6 Reputation points
2021-11-01T11:32:28.233+00:00

HI Team,

I wanted to Send email via graph API. I followed the documentation and Created a application in Azure Directory and got Admin Consent permission for mail.send.

I am using the below URL https://graph.microsoft.com/v1.0/dinesh.test[@](/users/na/?userId=12dda09b-4001-0003-0000-000000000000).com/sendMail

In the headers I am passing the Bearer token.

When I tried to execute this i am getting below error

{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'dinesh.test@ssss .com'.",
"innerError": {
"date": "2021-11-01T11:26:02",
"request-id": "90a7aea5-29ea-49c2-b297-695ee0f2d296",
"client-request-id": "90a7aea5-29ea-49c2-b297-695ee0f2d296"
}
}
}

The email id i have used present in the AD.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,715 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Glen Scales 4,431 Reputation points
    2021-11-01T23:05:16.267+00:00

    Your URL is wrong your missing the users segment so it should be

    https://graph.microsoft.com/v1.0/users/dinesh.test@example.com/sendMail
    

  2. Deep Roy 0 Reputation points
    2023-08-24T06:37:44.1933333+00:00
    {
        "error": {
            "code": "BadRequest",
            "message": "Resource not found for the segment 'onlineMeetings'.",
            "innerError": {
                "date": "2023-08-24T06:13:35",
                "request-id": "30976cc5-c8a6-4f3f-86d3-b347836ebe52",
                "client-request-id": "30976cc5-c8a6-4f3f-86d3-b347836ebe52"
            }
        }
    }
    
    
    i found some errors like this by using 
    https://graph.microsoft.com/v1.0/onlineMeetings
     
    
    0 comments No comments