question

DineshKumarPutla-0182 avatar image
0 Votes"
DineshKumarPutla-0182 asked GlenScales-6756 answered

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

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@example.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@example.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-mail
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

GlenScales-6756 avatar image
0 Votes"
GlenScales-6756 answered

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.