Hi Ojas,
you can use :-
var fileAttachment = attachmentRequest.Result as Microsoft.Graph.FileAttachment;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I am currently working on a Springboot Java project which is using MS graph API version 6.4.0 to read and move mails. After migration from version 2.10.0, and after multiple changes to existing code, I'm getting an error when reading the content of an attachment. Previously to get content the code was
String content = jsonArrayForAttachment.get(i).getAsJsonObject().get("contentBytes");
Where jsonArrayForAttachment is JsonArray and data stored is taken from
attachmentPage.getRawObject().get("value").getAsJsonArray();
Now I have changed above code to the following:
AttachmentCollectionResponse attachmentPage = null;
List<Attachment> attachmentValueList= attachmentPage.getValue();
The issue I'm facing is that there is no method: getContentBytes() inside the attachmentValueList.get(0) Attachment object.
I then use the content String like this : attachmentStream = new ByteArrayInputStream(Base64.getUrlDecoder().decode(content));
I need the contentBytes data to then read the contents of an attachment and then write that content to a new temporary location.
Any help would be helpful.
Hi Ojas,
you can use :-
var fileAttachment = attachmentRequest.Result as Microsoft.Graph.FileAttachment;