【问题标题】:How to increase time of office 365 push notification web hook verification如何增加office 365推送通知web hook验证时间
【发布时间】:2016-11-30 05:28:29
【问题描述】:

根据 microsoft Document 我必须遵循以下步骤:

如果侦听器服务成功验证 URL,它会返回一个 5秒内成功响应如下:

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

我的观点是这样的:

@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)'."}}

有没有办法延长时间限制?

【问题讨论】:

    标签: python flask outlook webhooks office365api


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-24
      • 2017-09-13
      • 1970-01-01
      • 1970-01-01
      • 2012-06-24
      • 2017-11-12
      相关资源
      最近更新 更多