Summary:
I am working on a website that connects to Facebook through the Graph API. I was asked whether I can get a user's profile picture if they are already logged into Facebook, but prior to the user authenticating the app. Is this possible?
EDIT:
I know you can get people's profile picture by going to http://graph.facebook.com/USERNAME_OR_USERID/picture?type=large
, but would I be able to get a user's username or ID if they are logged into Facebook, but have not authorized my app?
Details:
According to the Facebook API User documentation, you can get their Facebook ID without an access_token, and I know if you go directly to a user's /me URL you can see their basic information. With the Facebook ID, I can grab their profile pic.
However, when I try to call it from the website using the following code, I get an OAuthException error.
FB.api('/me', function(response) {
console.log(response);
});
I'm guessing that they have to authenticate the app, but I'm looking to see if I may have missed a way of getting their profile pic.
Thanks for your help!
The Graph API is free to use, for all applicable use cases.
PSID is a page-scoped ID for every contact in your Contacts that Facebook creates to handle different communication channels. It's common for a business to use multiple channels to communicate with its customers, e.g., a website, a mobile app, and Messenger.
You can get everyone's Facebook profile picture without authentication.
You just call http://graph.facebook.com/USERID/picture?type=large. This URL redirects you to image URL.
Edit: Querying by username is not allowed anymore, so I updated USERNAME_OR_USERID
as USERID
.
yes you can get..
http://graph.facebook.com/naseer.panhwer/picture?type=normal
http://graph.facebook.com/naseer.panhwer/picture?type=small
http://graph.facebook.com/naseer.panhwer/picture?type=large
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With