节点js

时间:2017-10-23 13:30:34

标签: node.js outlook-restapi

当我想使用outlook API注册订阅时,我遇到了验证通知网址的问题。

请求中传递的选项是:

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"
}

回复如下:

  

通知网址'https://xxx/callback?validationtoken=N2FhY2JhNmItYTc2MC00MGUwLThmOGItZWQ2N2Q5Nzg5Y2Y2'验证失败System.Net.WebException

     

请求已中止:无法创建SSL / TLS安全通道。    在System.Net.HttpWebRequest.GetResponse()    在Microsoft.Exchange.OData.Model.Notifications.PushNotification.PushSubscriptionCallbackUrlValidationHelper.SendRequestAndVerifyResponse(Uri callbackUrl,PushSubscription pushSubscription)。

当我使用Postman请求通知网址时,它会正常工作,并按预期返回200状态的验证令牌。

使用加密生成SSL证书。

0 个答案:

没有答案