Hello,
This code has been running for 2 years, now it started to fail after we paid an unpaid subscription.
not sure it's because of that but here we are.
I am using a registered application to get the bearer token for this
after making a post request to this
"https://graph.microsoft.com/v1.0/users/{userPrinciple}/messages/{messageId}/attachments/createUploadSession"
I am getting back the response with the uploadUrl to put the chunks of the attachment
and using it to upload the chunks like
using (var httpRequest = new HttpRequestMessage(HttpMethod.Put, uploadUrl));
> httpRequest.Content = new ByteArrayContent(body);
> httpRequest.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
httpRequest.Content.Headers.Add("Content-Length", $"{processingByteSize}");
httpRequest.Content.Headers.Add("Content-Range", $"bytes {completedByteSize}-{completedByteSize + processingByteSize - 1}/{attachmentBytes.Length}");
var response = await _client.SendAsync(httpRequest).ConfigureAwait(false);
but then I am getting Unauthorized response
Any luck what could be the reason?