30

Is there a way to get the user IDs of all the people who are using your Facebook application?

0

3 Answers 3

20

Doing an extensive research I concluded that there's NO method to do this!

What I have found:
An old REST API called friends.getAppUsers that gets all the IDs of the user's friends that authorized the application.

What I wish I had found:
After reading the App Login section in the authentication document:

In addition to User Login, Facebook Platform support App Login using the OAuth 2.0 Client Credential flow. App Login allows you to take various administrative actions for your app, such as retrieving Insights data or approving Requests.

I thought the application object would have a direct method for this (similar to accounts):

$facebook->api("/APP_ID/users");

But I was wrong. And then with the introduction of the insights feature, I was shocked that you can only get the count of the User IDs!

What you can do:
Storing the User ID in your DB as soon as a user authorize your application and if your application already has users (most likely the case), check if you have a record for each user that interacts with your application in your DB...this way, you'll get the User IDs for your active users in no time.

1
  • 2
    yeah that seems to be the best solution to store it in an extra db. but i thougth it would be nice .. not to store user data. so you also can get only one uid out of the event owner / creator content. also the event shows both of them. Jan 24, 2011 at 13:25
0

Just a little more on this - I managed to find a lot of the userIDs I was looking for by doing basic Graph API searches and then checking they were valid with my app.

Search an email address or username here:- https://developers.facebook.com/tools/explorer?method=GET

QUERY: https://graph.facebook.com/[email protected]&type=user

If you get a match or more than one, you can check it is valid as install on the FQL query button of the same explorer:-

SELECT uid FROM user WHERE uid = *USER_ID_TO_SEARCH* AND is_app_user = 1

If it appears as a uid, you're good - they're valid. This helped me get to what I needed (when I hadn't got some of my app users info on signup).

2
  • I couldn't figure out how to search an email from the graph api explorer. What syntax did you use? I tried 'SELECT name FROM user where contact_email = [email protected]' but it doesn't seem to like emails Oct 31, 2013 at 5:58
  • That search does not work in the new api (3) there is no type=user
    – Razvan.432
    Jan 25, 2019 at 12:36
0
GET /v2.10/{app-id}/accounts

You will get all the accounts for the application

1
  • This will get you application test accounts
    – Razvan.432
    Jan 25, 2019 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.