我目前正在开发一个伙伴关系。 NET 有助于设立小组会议和检索URL链接的网播。 我一直关注微软的文件,但似乎不完整,我正遇到许多错误。
我在一份普通照会中添加了一个编号:OnlineMeetings。 阅读。 所有
。 我应该能够同时建立多种联系,而不使用一个通用账户。 我只想授权我的资源来创造会议。
var tenantId = "...";
var clientId = "...";
var clientSecret = "...";
var options = new TokenCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
};
var clientSecretCredential = new ClientSecretCredential(tenantId, clientId, clientSecret, options);
var graphClient = new GraphServiceClient(clientSecretCredential);
var requestBody = new Microsoft.Graph.Users.Item.OnlineMeetings.CreateOrGet.CreateOrGetPostRequestBody
{
StartDateTime = DateTimeOffset.Parse("2024-02-20T14:30:00.2444915-07:00"),
EndDateTime = DateTimeOffset.Parse("2024-02-20T15:00:00.2464912-07:00"),
Subject = "Test meeting from graph API",
Participants = new MeetingParticipants
{
Organizer = new MeetingParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
Id = "[email protected]"
}
},
Upn = "[email protected]"
},
Attendees = new List<MeetingParticipantInfo>
{
new MeetingParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
Id = "[email protected]"
}
},
Upn = "[email protected]"
}
}
}
};
var result = await graphClient.Users["[email protected]"].OnlineMeetings.CreateOrGet.PostAsync(requestBody);
return result.JoinWebUrl;
在以特定全权证书执行该守则时,我正在发现这一错误:
微软.Graph.Models.ODataErrors.ODataError
缩略语
这一例外最初被推向这一呼吁中:
Library.Http.HttpClientRequestAdapter.ThrowIfFailedResponse(System.Net.Http.HttpResponseMessage, System.Collections.Generic.Dictionary<string, Library.Abstractions.Serialization.ParsableFactory<Library.Abstractions.Serialization.IParsable>>, System.Diagnostics.Activity, System.Threading.CancellationToken)
Library.Http.HttpClientRequestAdapter.SendAsync(Library.Abstractions.RequestInformation, Library.Abstractions.Serialization.ParsableFactory, System.Collections.Generic.Dictionary<string, Library.Abstractions.Serialization.ParsableFactory<Library.Abstractions.Serialization.IParsable>>, System.Threading.CancellationToken)
Library.Http.HttpClientRequestAdapter.SendAsync(Library.Abstractions.RequestInformation, Library.Abstractions.Serialization.ParsableFactory, System.Collections.Generic.Dictionary<string, Library.Abstractions.Serialization.ParsableFactory<Library.Abstractions.Serialization.IParsable>>, System.Threading.CancellationToken)
Users.Item.OnlineMeetings.CreateOrGet.CreateOrGetRequestBuilder.PostAsync(Users.Item.OnlineMeetings.CreateOrGet.CreateOrGetPostRequestBody, System.Action<Library.Abstractions.RequestConfiguration<Library.Abstractions.DefaultQueryParameters>>, System.Threading.CancellationToken) in CreateOrGetRequestBuilder.cs
App.Services.MeetingGeneratorService.CreateMeeting(App.Dto.v2.MeetingDto) in MeetingGeneratorService.cs