Instagram Ruby Gem - Unable to Reach Callback Url

Instagram ruby gem - Unable to reach callback URL

I had the same problem.

Seems that instagram doesn't reach the URLs that returns a blank page.

In my case, the script that receives the call had a syntax error and, with error_reporting=off, gives back an empty page. Once I've fixed the script, instagram starts to reach the URL.

Instagram Unable to reach callback URL

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.

Instagram Real-Time API Callback URL Escaping

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 client
users = 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

Pulling images from Instagram Gem over secure domain

Instagram will serve assets over http and https, so just adjust your URL. You can make the URL protocol relative, so that the image is always loaded in the browser using the correct protocol. Try this in your view:

<%= image_tag i.images.standard_resolution.url.sub(/^https?\:/, '') %>


Related Topics



Leave a reply



Submit