scenterportal-6547 avatar image
0 Votes"
scenterportal-6547 asked Deva-MSFT edited

Error on sending graph api mail with upload session

Hi, the java application that I have to maintain
uses MS Graph API to sending mail.(java graph sdk version is 1.9.0)
But recently I noticed that It is not able to send the email with the file attachment which is more than 3MB.

After searching the internet, I noticed it needs to make uploadsession if I want to attach more than 3MB attachment

So I changed my code with following reference.
(1. save mail as a draft status, 2. make uploadsession, 3. upload the big size file to the uploadsession, 4. sending mail on the draft box)

But after changing code, I got error below Error code: InvalidAudienceForResource
Error message: The audience claim value is invalid for current resource. Audience claim is '', request url is '

It seems that my GraphServiceClient uses access token from scope "" and this not working with uploadsession for big size attachment.
Also My java application uses msal client to get access token

In this case, I don't know what I have to do to solve this problem.
Please help me

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.

0 Answers