使用 Node JS 在 Office365 上召开会议室会议 - REST API
Get room meetings on Office365 using Node JS - REST API
我想要在会议室中召开所有会议。我正在使用以下代码,但我想使用 Node JS。那我可以做这个手术吗?如果是怎么办?我无法提供有关此问题的任何信息。所有示例和代码结构都用于获取我自己的会议。非常感谢。
public void get_rooms()
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new WebCredentials("user@example.com", "password");
service.Url = new Uri("https://outlook.office365.com/ews/exchange.asmx");
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "ROOM_1@example.com");
DateTime startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 8, 0, 0);
DateTime endDate = startDate.AddHours(12);
CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar, new PropertySet());
CalendarView cView = new CalendarView(startDate, endDate);
cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start,
AppointmentSchema.End, AppointmentSchema.Organizer,
AppointmentSchema.AppointmentState, AppointmentSchema.Id);
List<string> MailAddress = new List<string>();
FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);
foreach (Appointment appointment_result in appointments)
{
Appointment appointmentDetailed = Appointment.Bind(service, appointment_result.Id,
new PropertySet(BasePropertySet.FirstClassProperties)
{
RequestedBodyType = BodyType.Text
});
foreach (Attendee attendee in appointmentDetailed.RequiredAttendees)
{
listBox1.Items.Add("Attendee Mail: " + attendee.Address.ToString());
}
listBox1.Items.Add("Organizer: "appointment_result.Organizer.Name);
}
}
您的问题有点太宽泛了,有一个 javascript 版本的 EWS Managed API(您在上面发布的代码)https://github.com/gautamsi/ews-javascript-api this should work okay in Node Js. You could also do the same thing using the Graph API (REST) which there are samples for https://github.com/microsoftgraph/nodejs-connect-rest-sample。这些是我建议您开始的地方。
在您发布的 EWS 代码中,这是使用模拟访问房间邮箱而不是模拟,您应该能够使用委托,例如
FolderId RoomMailboxFolderId = new FolderId(WellKnownFolderName.Calendar,"Room@domain.com");
CalendarFolder calendar = CalendarFolder.Bind(service, RoomMailboxFolderId, new PropertySet());
然后,您无需不断更改您模拟的帐户即可访问其他房间日历。
我想要在会议室中召开所有会议。我正在使用以下代码,但我想使用 Node JS。那我可以做这个手术吗?如果是怎么办?我无法提供有关此问题的任何信息。所有示例和代码结构都用于获取我自己的会议。非常感谢。
public void get_rooms()
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
service.Credentials = new WebCredentials("user@example.com", "password");
service.Url = new Uri("https://outlook.office365.com/ews/exchange.asmx");
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "ROOM_1@example.com");
DateTime startDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 8, 0, 0);
DateTime endDate = startDate.AddHours(12);
CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar, new PropertySet());
CalendarView cView = new CalendarView(startDate, endDate);
cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start,
AppointmentSchema.End, AppointmentSchema.Organizer,
AppointmentSchema.AppointmentState, AppointmentSchema.Id);
List<string> MailAddress = new List<string>();
FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);
foreach (Appointment appointment_result in appointments)
{
Appointment appointmentDetailed = Appointment.Bind(service, appointment_result.Id,
new PropertySet(BasePropertySet.FirstClassProperties)
{
RequestedBodyType = BodyType.Text
});
foreach (Attendee attendee in appointmentDetailed.RequiredAttendees)
{
listBox1.Items.Add("Attendee Mail: " + attendee.Address.ToString());
}
listBox1.Items.Add("Organizer: "appointment_result.Organizer.Name);
}
}
您的问题有点太宽泛了,有一个 javascript 版本的 EWS Managed API(您在上面发布的代码)https://github.com/gautamsi/ews-javascript-api this should work okay in Node Js. You could also do the same thing using the Graph API (REST) which there are samples for https://github.com/microsoftgraph/nodejs-connect-rest-sample。这些是我建议您开始的地方。
在您发布的 EWS 代码中,这是使用模拟访问房间邮箱而不是模拟,您应该能够使用委托,例如
FolderId RoomMailboxFolderId = new FolderId(WellKnownFolderName.Calendar,"Room@domain.com");
CalendarFolder calendar = CalendarFolder.Bind(service, RoomMailboxFolderId, new PropertySet());
然后,您无需不断更改您模拟的帐户即可访问其他房间日历。