Reputation: 8948
I've been using the Instagram RealTime API for some time now without problems. However, I switched hosting server for my website a couple of days ago, and since then I've been having problems registering subscriptions.
To debug the problem I've been using powershell to invoke the POST command to add new subscriptions like this:
$postParams = @{callback_url='http://example.com/callback';object='tag';aspect='media';object_id='sometag';client_id='CLIENT_ID';client_secret='CLIENT_SECRET'}
Invoke-WebRequest -Uri https://api.instagram.com/v1/subscriptions/ -Method POST -Body $postParams
If I invoke that on my developer machine, I get a 200 in response and I see that the subscription is listed if I call:
https://api.instagram.com/v1/subscriptions?client_secret=CLIENT_SECRET&client_id=CLIENT_ID
However, If I invoke that exact command in powershell on my webserver where my site is hosted I get a 400 with error message 'Unable to reach callback URL "http://example.com/callback"'
What could be the source of this problem? I've tried to register a new application, but I got the same error there. At first I thought it had something to do with DNS issues, but since Instagram are able to reach http://example.com/callback when I issue the command from my developer machine, shouldn't they be able to reach that same URL even if my request comes from another server?
Upvotes: 2
Views: 1403
Reputation: 502
The error Unable to reach callback URL
might be misleading. I had the same issue, same command, different IP and in one case it works, in the other it does not. I suspect it is an Instagram issue rejecting subscriptions from some IPs while others not.
Upvotes: 1