Getting MIME content is not working in Graph API ( 3.1.0) for Java SDK
Hi Support team,
I am trying to get the mime-content of the message with attachment,
I am using 3.1.0, which has content method, I am using this method to get the mime-content(uses /$value), below is my request. Below is the reference docuementation we are using.
I am getting the response with code 200 and header as Content-Type: text/plain, body has nothing and body.contentLength() is coming as -1,
Kindly help me if I am missing anything in the request/headers
Code for mime content for message:
Request: https://graph.microsoft.com/v1.0/users/{Email Id}/messages/{message id}/$value
graphClient.users({emailId}).messages(message.id).content()
.buildRequest()
.get();
I tried to fetch the same mime-content for attachment as well, below is the code
final String baseUrl = graphClient.users(userProfile).messages(message.id).attachments(attchId).buildRequest().getRequestUrl().toString();
final CustomRequestBuilder downloadRequestBuilder = new CustomRequestBuilder<>(baseUrl + "/$value", graphClient, new ArrayList(), InputStream.class);
final InputStream stream = downloadRequestBuilder.buildRequest().get();
In either case, I am getting the body as empty and body.contentLenght() is -1.
Kindly help me on this.