How to retrieve user ids of all users of a fb graph application?

72 views Asked by At

I cannot find a method in restfb to find all the userids of the users who have connected to my facebook application. I am using fbgraphapi version 3.2

I have tried an old method, friends.getAppUsers, but found that it did not work. I cannot find a query in the graph api explorer v3.2 that would retrieve user ids either.

In graph api explorer I have:

my_app_id?fields=id,name

but then I cannot find any fields or connections that would retrieve the user ids of those using my app. In my application:

private static final String MY_APP_ID = "myappid";
private static final String MY_APP_SECRET = "myappsecret";
private static final String MY_ACCESS_TOKEN = "myaccesstoken"; 

public static void main(String[] args) {
        String accessToken = new DefaultFacebookClient(MY_ACCESS_TOKEN, Version.LATEST).obtainExtendedAccessToken(MY_APP_ID, MY_APP_SECRET, MY_ACCESS_TOKEN).getAccessToken();
        FacebookClient facebookClient = new DefaultFacebookClient(accessToken, Version.VERSION_2_10);

I have facebookClient but I assume this is at the user level so I'm not sure if in restfb I can query at the app level to find the list of user ids.

1

There are 1 answers

0
andyrandy On

There is no API to get all users who authorized your App. The only way to get that list is to store them when they authorize (or re-visit) your App.