Tag: outlook restapi

与节点js的Outlook api webhookvalidation错误

当我想要使用outlook API注册订阅时,我遇到了通知URL的validation问题。 请求中传递的选项是: var optionsSubscription = { url: "https://outlook.office.com/api/v2.0/me/subscriptions", method: "POST", headers: { "authorization": "Bearer " + user.outlookCalAccessToken, "accept": "application/json", "ContentType": "application/json", }, json: { "@odata.type": "#Microsoft.OutlookServices.PushSubscription", "Resource": "me/events", "NotificationURL": "https://xxx/callback", "ChangeType": "Created,Deleted,Updated" }, "Content-Type": "application/json" } 答复如下: 通知URL 'https://xxx/callback?validationtoken=N2FhY2JhNmItYTc2MC00MGUwLThmOGItZWQ2N2Q5Nzg5Y2Y2'validation失败System.Net.WebException : 该请求被中止:无法创buildSSL / TLS安全通道。 在System.Net.HttpWebRequest.GetResponse()在Microsoft.Exchange.OData.Model.Notifications.PushNotification.PushSubscriptionCallbackUrlValidationHelper.SendRequestAndVerifyResponse(Uri callbackUrl,PushSubscription pushSubscription)。 当我通过Postman请求通知URL时,它将正常工作并返回200状态的validation令牌。 SSL证书是用我们encryption生成的。

Outlook API获取消息不返回附件集合

我正在使用Outlook Mail REST API来获取用户电子邮件集合的JSON对象,并将数据显示在自定义Web界面中。 我需要显示一个电子邮件列表,列表中的每封电子邮件都需要一个指示该电子邮件的附件数量。 我正在使用从Outlook Mail REST API reference #Getmessages获取邮件Outlook Mail REST API reference #Getmessages路由获取所需的所有数据来执行此操作。 但是,当我在我的$select中指定我需要Attachments ,我从来没有得到每个电子邮件的附件集合; 它只是失踪。 我可以为每封电子邮件分别获取附件集合,并为每封电子邮件提供一个单独的请求,如果我需要同时附加100封电子邮件,这将会很难看。 据此:( https://msdn.microsoft.com/office/office365/api/complex-types-for-mail-contacts-calendar#RESTAPIResourcesMessage )我应该能够指定,如果我想附件收集时,我得到消息,但它不工作。 我正在使用Node.js来获取电子邮件collections: var requestUrl = "https://outlook.office.com/api/v2.0/me/messages"; var queryParams = { '$select': 'Subject, ReceivedDateTime, From, ToRecipients, HasAttachments, Attachments, WebLink, CcRecipients, Body', '$orderby': 'ReceivedDateTime desc', '$filter' : dateString, '$top': 300 }; … 收集中返回的电子邮件对象 $select每个选项在包含或排除它时Attachments正常工作,但Attachments始终缺失。 有没有人有办法解决吗?

日历中的Outlook API时间差异

我在使用Calendar API的时候遇到了问题,特别是使用了Calendar API。 我用UTC格式发送date,当它们被添加到日历中时,我与发送date有所不同。 我在法国,原来的date是UTC + 2。 我在UTC转换,并使用此configuration请求: var options = { url: "https://outlook.office.com/api/v2.0/me/calendars/" + workspace.calendarId + "/events?$Select=Id", method: "POST", headers: { "authorization": "Bearer " + host.outlookCalAccessToken, "accept" : "application/json", "ContentType" : "application/json" }, json:{ "Subject" : event.summary, "Body" : { "ContentType" : "Text", "Content" : event.description }, "Start" : { "DateTime":start, "TimeZone" : "OriginStartTimeZone" […]

删除用户写下的所有文字

我使用Outlook API来获取发送的电子邮件的正文。 现在,我想清理身体删除所有链接,标题等,只保留用户写的文字。 以下是我的正则expression式函数: function getRegex() { var regex1 = /^(?=.*Forwarded message)[^]*/m; var regex2 = /^(?=.*From: )[^]*/m; var regex3 = /^(?=.*On )[^]*/m; var regex4 = /^(?=.*http)[^]*/m; return new RegExp("(" + regex1.source + ")|(" + regex2.source + ")|(" + regex3.source + ")|(" + regex4.source + ")"); } 以下是从Outlook中获取发送的电子邮件的function: outlook.mail.getMessages({ token: token.token.access_token, odataParams: queryParams, folderId: 'SentItems' }, […]