How to get all the user IDs of people who are using your Facebook application

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.

Leave a Comment