Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Subscription validation request timed out #9

Closed
alekkowalczyk opened this issue Jan 12, 2017 · 5 comments
Closed

Subscription validation request timed out #9

alekkowalczyk opened this issue Jan 12, 2017 · 5 comments
Assignees

Comments

@alekkowalczyk
Copy link

This is the ruby code I'm using to create a subscription in microsoft graph:

        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'
        )

it worked great, but suddenly today I'm getting a Subscription validation request timed out response. Altough when I'm doing a POST to https://my_url/api/v1/outlook/o365notification it's just working fine.

Any ideas why it stopped working when nothing changed on my side?

Could it be that, because my_url points on my dev environment and is often offline, the domain got banned?

@DianeD
Copy link
Contributor

DianeD commented Jan 12, 2017

Hi @alekkowalczyk . Since setting up my notification endpoint, I've only gotten that error when my service is offline (which also happens a lot). I just retested and I'm able to create a subscription.

Any chance your response time has slowed down?

I forwarded your question along to see if we can troubleshoot on this end.

@DianeD DianeD self-assigned this Jan 12, 2017
@alekkowalczyk
Copy link
Author

alekkowalczyk commented Jan 13, 2017

Hi @DianeD thanks for the quick response.
I don't think the response time slowed down, when I do an POST call to the endpoint from Fiddler, the response is quick, it's a dev environment so it can take up to a half second but nowhere long enough to do an timeout if it's not set to extremely low values.

@DianeD
Copy link
Contributor

DianeD commented Jan 13, 2017

@alekkowalczyk
Copy link
Author

alekkowalczyk commented Jan 13, 2017 via email

@DianeD
Copy link
Contributor

DianeD commented Jan 17, 2017

Issue was resolved on StackOverflow:

"If anybody is interested: after our offline follow up it turned out that it's a connection issue, after my endpoint was deployed on a cloud service it worked. For endpoints pointing to dev machines ngrok is suggested."

Thanks for reporting, @alekkowalczyk !

@DianeD DianeD closed this as completed Jan 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants