-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to provide base64 encoded MIME content when replying to message. #1802
Comments
Thanks for raising this @bkaankose The metadata used to generate the SDK is missing the Mime path but this can be possibly resolved as below as this is fixed. var base64content = "";
var requestInformation = graphClient.Me.Messages["{message-id}"].CreateReply.ToPostRequestInformation(new ());
requestInformation.Headers.Clear();// replace the json content header
requestInformation.SetStreamContent(new MemoryStream(Encoding.UTF8.GetBytes(base64content)));
var result = await graphClient.RequestAdapter.SendAsync<Message>(requestInformation, Message.CreateFromDiscriminatorValue); |
Thanks for the alternative, it works for SendAsync if I add "text/plain" as it is suggested in the documentation, but it doesn't work for Batch requests. I construct the RequestInformation and pass it to Batch with AddBatchRequestStepAsync. Calling this line fails with the following exception: JsonReaderException: 'R' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0. StackTrace
Even though the response is expected to return Message, I believe response parser is trying to deserialize the response as 'text/plain' as it was stated in my request. Is there a way to parse the response without having crash on PostAsync call? |
To add to the context, response returned from this call is actually bas64 encoded string of the mime content. |
This issue also applies to both |
This was working for 5.4.0 but looks like it is broken now. I receive 415 from the API in 5.26.0. |
@andrueastman do we have some progress on this P1 issue? |
I believe 415 suggests that the content type is incorrect. Any chance it works out if you update the sample as below to include the content type header when setting the content @bkaankose. requestInformation.SetStreamContent(new MemoryStream(Encoding.UTF8.GetBytes(base64content)),"text/plain");
This should already be resolved in the latest SDK version as you set non json bodies in Batch requests via microsoftgraph/msgraph-sdk-dotnet-core#701 As the batch request issue is resolved, we would need to resolve the metadata issue to include the text/plain format of the message. |
Describe the bug
This documentation says there are 2 ways to create a draft reply for an existing outlook message. First way is probably working, but in v5 there is no way to create this Http Post request for sending raw MIME content.
Microsoft.Graph.Me.Messages.Item.CreateReply.CreateReplyPostRequestBody this metadata does not include a property (Content) to provide raw mime.
Expected behavior
There should be a method or metadata update that will enable developers to provide encoded mime content to create reply for a message as a draft.
Additional context
Version 5.4.0
The text was updated successfully, but these errors were encountered: