事件未在同一呼叫中为多个用户创建应用程序许可
我已经在Azure Directory中注册了该应用程序的应用程序,并且可以通过一次为单个用户使用相同的令牌来获取令牌并安排事件,但是当我添加多个参与者时(
GraphServiceClient(accessToken).Users["[email protected]"].Events.Request().AddAsync(@event);
“ __cf_email__” data-cfemail = “ 交付未能输入这些接收者或组:
我在邮件中还遇到了一些错误,以获取
管理员的诊断信息:
生成服务器:SA0PR19MB4602.NAMPRD19.PROD.OUTLOOD.com
[email  procepted] 远程服务器返回'550 5.7.501服务不可用。从IP范围检测到垃圾邮件滥用。有关更多信息,请转到 http://go.microsoft.com/fwlink/?linkid = linkid= 526653 。 S(2017052602)[BYAPR19MB3063.NAMPRD19.PROD.OUTLOOK.com]'
原始消息标头:
Received: from SA0PR19MB4602.namprd19.prod.outlook.com
([fe80::d4d8:a608:e081:3249]) by SA0PR19MB4602.namprd19.prod.outlook.com
([fe80::d4d8:a608:e081:3249%7]) with mapi id 15.20.5373.018; Tue, 28 Jun 2022
13:43:23 +0000
MIME-Version: 1.0
Content-Type: text/plain
Date: Tue, 28 Jun 2022 13:43:23 +0000
Message-ID:
<SA0PR19MB4602896A05ED8C22B925567688B89@SA0PR19MB4602.namprd19.prod.outlook.com>
Subject: Schedule From .Net
代码
public static async Task<Event> CreateEvent(string accessToken)
{
Event event1 = new Event();
var @event = new Event
{
Subject = "Schedule From .Net",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Test Schedule"
},
Start = new DateTimeTimeZone
{
DateTime = "2022-07-10T12:00:00",
TimeZone = "Pacific Standard Time"
},
End = new DateTimeTimeZone
{
DateTime = "2022-07-10T14:00:00",
TimeZone = "Pacific Standard Time"
},
Location = new Location
{
DisplayName = "OR1"
},
Attendees = new List<Attendee>()
{
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "[email protected]",
Name = "Vinay"
},
Type = AttendeeType.Required
},
new Attendee
{
EmailAddress = new EmailAddress
{
Address = "[email protected]",
Name = "Adelev"
},
Type = AttendeeType.Required
}
},
TransactionId = Guid.NewGuid().ToString()
};
try
{
event1 = await GraphServiceClient(accessToken).Users["[email protected]"].Events.Request().AddAsync(@event);
}
catch (Exception ex)
{
}
return event1;
}
可以检查并建议我们如何通过使用相同时间在您同时安排多个用户。
是否有任何选项可以更改以下代码以在用户中添加多个电子邮件[]数组中
GraphServiceClient(accessToken).Users["[email protected]"].Events.Request().AddAsync(@event);
,
GraphServiceClient(accessToken).Users["[email protected],[email protected]"].Events.Request().AddAsync(@event);
但这会出现错误,如下所示
Code: ResourceNotFound
Message: Resource could not be discovered.
Inner error:
AdditionalData:
date: 2022-06-28T14:41:33
request-id: 41cf2d89-de6d-44df-b42f-1e11d2fe430e
client-request-id: 41cf2d89-de6d-44df-b42f-1e11d2fe430e
ClientRequestId: 41cf2d89-de6d-44df-b42f-1e11d2fe430e
,请建议我们必须以哪种方式呼叫
。 Srikanth
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,请按照下面的代码进行测试。
我仔细确认了您的代码,并检查了官方API文档,我注意到您所写的是
等待GraphServiceClient(accessToken).uSers [users ['等待GraphClient.me.calendars [“ {calendar-id}”]。events.request()。addAsync(@event);
,因此您可能需要使用代码graphServServiceClient(AccessToken).users [users [users [users] “
而不是。
Sorry pls follow the code below and have a test.
I double confirmed your code and checked the official api document, I noticed that what you wrote is
await GraphServiceClient(accessToken).Users["[email protected]"].Events.Request().AddAsync(@event)
while the sample code isawait graphClient.Me.Calendars["{calendar-id}"].Events.Request().AddAsync(@event);
, so you may need to use codeGraphServiceClient(accessToken).Users["[email protected]"].Calendars["{calendar-id}"].Events.Request().AddAsync(@event);
instead.