Facebook - "Cannot query users by their username" solution
Asked Answered
R

1

23

I am developing an android app. I was using a HttpURLConnection to get profile pictures of facebook users. The URL looks like this:

http://graph.facebook.com/?ids=username1,username2,username3&fields=picture&type=square

But now, since v2.2 doesn't let me to get profile pictures of users who are not using my facebook app, it throws an error:

{ "error": { "message": "(#803) Cannot query users by their username (username1)", "type": "OAuthException", "code": 803 } }

I am not interested in using "Facebook SDK for Android". Let's say I use a pop-up webview to authorize my facebook app. What url would let me do the same thing? Is there a simple solution like this:

graph.facebook.com/?app=APP-ID&ids=username1,username2&fields=picture

Rakel answered 17/6, 2015 at 8:40 Comment(0)
C
26

Since v2.0 of the API, you are not supposed to use usernames at all - and that´s why you can´t query users by their username anymore. The only way to get access to data of a user is by authorizing that user and using the /me endpoint.

Main rule: Forget about users who did not authorize your App, you are not supposed to get any data of those for privacy reason.

Cohleen answered 17/6, 2015 at 8:54 Comment(1)
they scrape the profile, which is not allowed on facebook. don´t do that.Cohleen

© 2022 - 2024 — McMap. All rights reserved.