Instagram Real-Time API Callback URL Escaping [duplicate] Instagram Real-Time API Callback URL Escaping [duplicate] curl curl

Instagram Real-Time API Callback URL Escaping [duplicate]


The callback url is fine. The extra \s you see are due to the way JSON encodes the / character. Check out the escape rules here: http://www.json.org/

The real problem is that Instagram's real-time subscriptions API seems to be having issues for the last couple days. See @DanShev's comment for the links.

In the mean time, I have a system in place to periodically look through my users' photos for photos that are of interest to me. My code (in Python) looks something like this:

from instagram import clientusers = InstagramUser.objects.all()for user in users:    api = client.InstagramAPI(access_token=user.access_token)    user_media, paginate_url = api.user_recent_media(user_id=user.instagram_user_id)    for media in user_media:        # Check if this is a media we've already gotten via subscription update        # Do somethign with the media


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.


This was actually a bug on Instagram's end. They fixed it, and it should be working now.