我正在尝试使用以下代码,但收到“消息:受众声明值对当前资源无效。受众声明为‘ https://graph.microsoft.com ’,请求 URL 为‘ https://outlook。 office.com/api/beta/Users ..."
我在 provider.GetUploadChunkRequests(); 拨打以下电话:
AttachmentItem attachmentItem= new AttachmentItem
{
Name = [Name],
AttachmentType = AttachmentType.File,
Size = [Size]
};
var session = graphClient.Users[USEREMAIL].Messages[MESSAGEID].Attachments.CreateUploadSession(attachmentItem).Request().PostAsync().Result;
var stream = new MemoryStream(BYTEARRAY);
var maxSizeChunk = DEFAULT_CHUNK_SIZE;
var provider = new ChunkedUploadProvider(session, graphClient, stream, maxSizeChunk);
var chunkRequests = provider.GetUploadChunkRequests();
(我正在使用graphClient成功发送电子邮件,并且还使用它使用uploadSession方法上传大文件)