Apologies, I can only include 2 URLs as a new user so I have had to econonomize.
I am having a problem where the user object in Facebook’s Graph API is not returning a profile image correctly. I can only find one case of this problem. For all other uses I have tested it appears to be working correctly. The profile image doesn’t seem to have any privacy settings, since I’m able to view it normally from the profile page.
I am using Facebook’s Graph API to load the profile image for a user/page by putting this URL into an IMG tag:
https://graph.facebook.com/%5Bprofile-id%5D/picture?type=square
This has worked in all cases I found during testing, including pages and users. For one of our users deploying the app on a page, however, the URL is loading the question mark image, as though there is no profile image for the page. Their page clearly has a profile image, as you can see here:
But if you click through to the Egan’s Calendar tab, you’ll see the question mark image. The image URL is the following, which returns the question mark:
https://graph.facebook.com/400488613342471/picture?type=square
I’ve checked the ID using the following link format, to ensure it’s the right ID for the page:
http://www.facebook.com/pages/%5Banything%5D/400488613342471
My first theory was that there were privacy settings on the profile image, but my personal account (as a non-fan of the page) is able to view the profile image. My only other idea is that perhaps it is because the page uses a short URL (EgansRestaurantPub) that doesn’t include the page ID. For similar pages, I found using the following worked:
[graphurl]/cocacola/picture
[graphurl]/BMW/picture
But when using the same method for my client’s page, it still returns a question mark.
Does anyone know why this is not returning the profile image for this page? This is the only page where I have found this problem.
I am using the PHP SDK and a bit of the JS SDK. I would prefer to avoid making another call to the API that would delay loading the page. That’s why I liked being able to throw the URL straight into the IMG tag. But I will make another call if there is no other way.
It seems there is some kind of restriction as mentioned in the
userdocument (picture field):You just need to supply a user
access_tokenfor this to work:To test this, you can directly get an access_token from the Access Token Tool.