如何增加office 365推送通知网络挂钩验证的时间

时间:2016-11-17 06:11:24

标签: python flask outlook webhooks office365api

根据微软Document,我必须遵循以下步骤:

  

如果侦听器服务成功验证了URL,则返回a   5秒内成功响应如下:

     
      
  1. 在响应标头totext \ plain。
  2. 中设置内容类型   
  3. 在响应正文中包含相同的验证令牌。
  4.   
  5. 返回HTTP 200响应代码。监听器可以随后丢弃验证令牌。
  6.   

我的观点是这样的:

@app.route('/outlook/push', methods=['POST'])
def outlook_push():
   return (request.args.get('validationtoken'), 200, {'Content-Type': 'plain/text'})

exceeds时间为limit(5s)

我收到这样的错误:

{'error': {'code': 'ErrorInvalidParameter', 'message': "Notification URL 'https://5cbae04e.ngrok.io/outlook/push?validationtoken=NmIzZDJiMTMtZjhmNy00ZWMwLTg1MDctNDQwMDQ0OWM2NmE1' verification failed 'System.Net.WebException: The operation has timed out\r\n   at System.Net.HttpWebRequest.GetResponse()\r\n   at Microsoft.Exchange.OData.Model.Notifications.PushNotification.PushSubscriptionCallbackUrlValidationHelper.SendRequestAndVerifyResponse(Uri callbackUrl, PushSubscription pushSubscription)'."}}

无论如何都要增加时间限制?

1 个答案:

答案 0 :(得分:0)

我认为它无法更改,您的问题可能是您的路由被定义为接受POST方法。 office365正在那里提出GET请求:)