Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

facebook

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

like image 872
Sven Koluem Avatar asked Jan 23 '11 22:01

Sven Koluem


People also ask

Is the Facebook API free?

In the newest version of the Graph API (v2. 9), we're announcing features that simplify development, making it even easier to build apps and experiences with Facebook. We're providing free access to over 140 million places around the world, the same data that powers Facebook, Instagram, and Messenger.

How are usernames and user IDs used on Facebook profiles?

Usernames and user IDs are part of your public profile, which can help your friends find you on Facebook. A username is the web address for your profile or Page (example: Facebook.com/yourname). Your username is often a variation of your name, like jane.

What data can I get from Facebook API?

With the Facebook Graph API, you can access a wide range of user data, including user information such as name, email address, birthday, and friends list in JSON. You can also access information about pages that a user has liked or engaged with on Facebook, as well as events and photos that they have posted or shared.


1 Answers

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.

like image 134
ifaour Avatar answered Oct 23 '22 20:10

ifaour