Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Office365 Microsoft Graph WebHook:订阅验证请求超时_Office365_Microsoft Graph Api_Office365api - Fatal编程技术网

Office365 Microsoft Graph WebHook:订阅验证请求超时

Office365 Microsoft Graph WebHook:订阅验证请求超时,office365,microsoft-graph-api,office365api,Office365,Microsoft Graph Api,Office365api,这是我用来在microsoft graph中创建订阅的ruby代码: subscribe_endpoint = URI("https://graph.microsoft.com/v1.0/subscriptions") http = Net::HTTP.new(subscribe_endpoint.host, subscribe_endpoint.port) http.use_ssl = true tomorrow = Date.today + 1 subscribe_request = "{

这是我用来在microsoft graph中创建订阅的ruby代码:

subscribe_endpoint = URI("https://graph.microsoft.com/v1.0/subscriptions")
http = Net::HTTP.new(subscribe_endpoint.host, subscribe_endpoint.port)
http.use_ssl = true
tomorrow = Date.today + 1

subscribe_request = "{
  \"changeType\": \"created,updated\",
  \"notificationUrl\": \"https://my_url/api/v1/outlook/o365notification\",
  \"resource\": \"/users/#{params[:o365account_id]}/events?$filter=Extensions/any(f:f/id eq 'Microsoft.OutlookServices.OpenTypeExtension.meeteor_event')\",
  \"expirationDateTime\": #{(Time.now + 1.day).to_json},
  \"clientState\": \"SecretClientState\"
}"

subscribe_response = http.post(
    "/v1.0/subscriptions",
    subscribe_request,
    'Authorization' => "Bearer #{params[:o365account_access_token]}",
    'Content-Type' => 'application/json'
)
它工作得很好,但今天我突然收到一个
订阅验证请求超时
响应。尽管我在向
https://my_url/api/v1/outlook/o365notification
它工作正常

你知道为什么在我这边什么都没变的时候它就停止工作了吗


可能是因为
my_url
指向我的开发环境并且经常处于脱机状态,所以域被禁止了吗?

您的通知服务器上可能有一些更改,包括服务或网络配置。它不响应验证请求。我还尝试使用HTTP而不是HTTPS向您的服务器发送请求,它返回了200,但在响应正文中没有验证令牌。

但是使用Fiddler在同一URL上发送请求一直有效(甚至在我的网络之外)。如果我的端点返回200而没有验证令牌,那么来自订阅端点的错误响应将不同于我收到的超时消息,看起来POST请求没有在提供的URL上执行。我向你的Gmail发送了一封电子邮件。让我们离线跟进,以避免披露您的服务器详细信息。如果有人感兴趣:在我们的离线跟进之后,发现这是一个连接问题,在我的端点部署到云服务上之后,它工作了。对于指向开发机器的端点,建议使用ngrok。