Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram Unable to reach callback URL

Tags:

instagram

I'm having weird problem that instagram won't allow me to subscribe to more tags. I subscribed yesterday to 3 tags without any problem, I tried today with new tag and no effect. Does somebody else have same problems?

I keep getting APISubscriptionError code 400 Unable to reach callback URL, but that URL is globaly accessible, even instagram is calling it every 5 min for tags i added yesterday.

Any ideas?

like image 480
gabrjan Avatar asked Apr 09 '14 08:04

gabrjan


2 Answers

This problem has now been fixed.

If it re-appears, here is workaround that I developed dealing with similar problems with the real-time API over the past couple years.

Set your system up to use both the real-time API as well as the search API as a fallback. Ingest data coming through the real-time calls, but also periodically poll the search endpoint (either media/search or tag/search, depending on your application) for data you might have missed, ignoring IDs your system has already seen.

Your system will be much more resilient to issues with the Instagram API and also allow restarting your system periodically without missing data (since you can catch back up to real-time).

I keep track of "seen" Instagram IDs in a Redis set.

like image 74
uberdog Avatar answered Oct 19 '22 15:10

uberdog


I originally posted the below answer at this question but thought I'd answer here as well since this question deals with essentially the same problem.


I've been having the same issue over the last few days. As a last ditch effort, I tried clearing all my subscriptions using the API, in case there were orphans running through the system. YMMV, but this ended up solving my "Cannot reach callback_url" problems.

The final section of the Realtime Photo Updates API docs has the details. To quickly test from the command line, give their curl example a go:

curl -X DELETE 'https://api.instagram.com/v1/subscriptions?client_secret=CLIENT-SECRET&object=all&client_id=CLIENT-ID'

If this ends up working for you, I'd recommend updating your app code to delete any existing subscriptions for a given client_id before starting a new subscription. Of course, this is only viable if you limit yourself to creating one subscription per set of credentials. If you're creating more than one subscription, you'll need to keep track of the queries that make up your active subscriptions and delete those that already exist before recreating.

like image 30
capelio Avatar answered Oct 19 '22 14:10

capelio