使用Node JS在Office365上举行会议室会议-REST API - c#

我要在房间里开会。我正在使用以下代码,但我想使用Node JS。那我可以做这个手术吗?如果是,怎么办?我没有关于此问题的任何信息。所有示例和代码结构都用于召开我自己的会议。非常感谢。

public void get_rooms()
        {
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
            service.Credentials = new WebCredentials("[email protected]", "password");
            service.Url = new Uri("https://outlook.office365.com/ews/exchange.asmx");
            service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");

            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);
            }
        }

参考方案

您的问题有点太宽泛了,有一个EWS托管API的javascript版本(您在上面发布的代码)https://github.com/gautamsi/ews-javascript-api在Node Js中应该可以正常工作。您也可以使用Graph API(REST)执行相同的操作,其中有https://github.com/microsoftgraph/nodejs-connect-rest-sample的示例。这些是我建议您开始的地方。

在您发布的EWS代码上,这是使用模拟访问房间邮箱,而不是模拟,您应该只能使用委托,例如

FolderId RoomMailboxFolderId = new FolderId(WellKnownFolderName.Calendar,"[email protected]");
CalendarFolder calendar = CalendarFolder.Bind(service, RoomMailboxFolderId, new PropertySet());

然后,您无需继续模拟其他房间日历的访问权限来更改帐户。

改造正在返回一个空的响应主体 - java

我正在尝试使用Retrofit和Gson解析一些JSON。但是,我得到的响应机构是空的。当我尝试从对象中打印信息时,出现NullPointerException。我确保URL正确,并且我也确保POJO也正确。我正在使用jsonschema2pojo来帮助创建POJO类。这是我要解析的JSON{ "?xml": { "@versi…

我需要帮助将此REST API Curl命令转换为Python请求 - python

我在这里是新手,老实说对所有编码都是新手。我正在尝试创建一个Pyton脚本,以使用REST API从Request Tracker资产数据库中搜索项目。到目前为止,我得到了以下Curl命令:curl -X POST \ -H "Content-Type: application/json" \ -d '[{ "fiel…

重复使用Google Api Bearer令牌来访问用户的云端硬盘 - javascript

我有以下几点: gapi.auth.authorize( { client_id: CLIENT_ID, scope: SCOPES, immediate: false }, handleAuthResult); 这使我可以访问access_token:目标是使该应用程序的用户可以授予对我的应用程序的访问权限,以使用其Google驱动器存储其内容。我需要能够…

从代码和网站调用Web API - c#

首先,我使用C#4.0作为编码语言。我相信我看到了一些答案,其中4.5引入了一些可以使此操作变得容易得多的方法,但这不是我要求更改框架。我正在创建一个MVC4 WebApi,它将同时被网站和C#代码使用(在另一个项目中)。通常,当从JavaScript调用时,我会这样做:$.ajax({ dataType: 'text', url: &#…

Google Analytics API fromdate,todate。如何从开始跟踪时开始? - c#

我是C#的新手,正在创建一个控制台应用程序,该应用程序使用API​​连接到Google Analytics(分析)。我知道了,因此它可以将控制台中捕获的数据写入并导出为CSV,但是我在这里指定了日期:static void Main(string[] args) { Authenticate(); **getVisits("2013-01-01&#…