MS Graph mail send API throwing "ErrorQuotaExceeded Cannot get ID from name" error

Sudhanshu Sharma 10 Reputation points
2023-08-05T08:53:30.3633333+00:00

Error:

{
    "statusCode": 403,
    "code": "ErrorQuotaExceeded",
    "requestId": null,
    "date": "2023-08-04T20:58:35.640Z",
    "body": "{\"code\":\"ErrorQuotaExceeded\",\"message\":\"Cannot get ID from name.\"}"
}

Hi, I am trying to send an email, using the graph API. I'm getting above mentioned error only for a specific user.

I'm sharing my code.

const mail = {
      subject: `${email_data.subject}`,
      toRecipients,
      ccRecipients,
      bccRecipients,
      body: {
        content: ' Hi, test mail ',
        contentType: 'html',
      },
      attachments,
      singleValueExtendedProperties: [
        {
          id: `String {${outlook_mail_guid}} Name oc_guid`,
          value: 'createActivity',
        },
      ],
    };

let email = await CLIENT.api('/me/sendMail').post({ message: mail });

   

this code is working fine for all other users but my one user is getting

"{\"code\":\"ErrorQuotaExceeded\",\"message\":\"Cannot get ID from name.\"}"

this error. I debugged and found it's throwing an error because of the "singleValueExtendedProperties" id key if I don't pass this key in the mail payload then it works fine.
Please help me and let me know if you need any additional details from my end to investigate further.
Thanks

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,828 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.