Search code examples
ruby-on-rails-4facebook-graph-apikoala

unreachable picture urls (403) returned by taggable_friends using Koala Rails Gem


I am using Koala gem to get taggable_friends of logged in users of my app.

When using the taggable_friends via the Facebook API explorer i get picture urls of this type:

https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/s50x50/1511494_10101263181401141_1434607512_n.jpg?oh=c5abb8d9ba6cfba11ccd96a4e2677bc2&oe=573D99E5&gda=1462771015_c580b7037fe88c460cc4a288ef23b009

which work fine.

However, when calling the taggable_friends function via code (Rails version 4 with Koala gem) for the same user and the same Facebook app, I am getting the exact same ids and name data, but for the profile pics I am getting this type of URL back:

https://scontent.xx.fbcdn.net/hprofile-xaf1/v/t1.0-1/c50.50.621.621/s50x50/1004433_10200680766036422_1106849516_n.jpg?oh=8e7726bd164064d4306edf55f51810a5&oe=57334e02

These picture URLs mostly fail with a 403. Strangely, about 5% of the profile pictures returned do work, but 95% return the 403.

BTW I have tried both with and without the app secret security enabled for my app but I still get back these unreachable URLs.

Any help is appreciated


Solution

  • Ok. Finally figured it out. Our javascript function was changing picture url to downcase and thus links didn't work. FB picture URLs ARE case sensitive as it turns out.