Using FQL to retrieve facebook status's of all users who are using My Facebook Application - facebook

I would like to retrieve status's of all users who are using my Facebook application.
I am not interested in retrieving the user's friends statuses only interested in retrieving the users who are using my Facebook application and have granted my application the "read_stream" permission.
I can successfully retrieve status's of the logged in user or one of the logged in user's friends by calling:
SELECT post_id, message, attachment, type FROM stream WHERE source_id = "SOME ID" AND type IN (46, 247)
But that is not my goal. I would like to get "All" users who are using my Facebook application and get their latest status feed without any particular user being logged in.
For example: I am not logged in facebook now neither or you. But when you click the link below you will get an RSS Feed of this particular user. This user is actually a business page so it is open to the public. Click This Link
I would like to retrieve this information from users who allow my application "read stream" permissions.
I cannot retrieve this information on personal Facebook user pages. So I am under the impression I need to build a Facebook Application to do so.

There is no way to retrieve a list of the user IDs of your app's users, and if you already have the user IDs you already have the correct query format - you just use the access token from the users to make that call
The fact you can't retrieve a list is covered here: Facebook. How to get list of all users of my app?
If you need the status updates of all your users, you should probably be using the Realtime Updates API to get a notification sent to your app when the user adds a new message, you can then use a cached [and still valid] access token for that user to retrieve the new messages

Related

How to get the user's list of accounts in Facebook API?

Good day, the app can't get access to the user's list of accounts. "me/accounts" returns an empty array.
I have checked this by creating a test application in the user's account and opening access to "pages_show_list". I executed it in Graph API Explorer and got the list. However, through another application, I can't access the list of accounts, even though it has Advanced access for pages_show_list.
When logging in through Facebook, I request "pages_show_list, instagram_basic, instagram_manage_messages, pages_manage_metadata, pages_read_engagement, public_profile". I have Advanced access to these permissions in my app.
When opening the Facebook login, it only requests the name and profile photo. Do I need to get any other permissions?

Is it posible to use facebook graph api to list a page feed without authorizing APP

I want to access next
graph.facebook.com/pagename/feed/
but I don't want the app to ask the users for permissions, since this information is public available. Is it somehow posible? Until now what I get is:
fbtrace_id
"G69vv730PRn"
message
"(#200) The user hasn't authorized the application to perform this action"
type
"OAuthException"
With an access token generated by explorer.
What I want to do is next:
A user input the page name or id, retrieve last posts, and then for each post retrieve likes and comments.
I mean can't I do something like:
http://graph.facebook.com/v2.7/pagename
and get page information?

How do I get my Facebook app's authorized users with App access token? [duplicate]

Is there a way to get the user IDs of all the 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.
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/search?q=user#email.com&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).
GET /v2.10/{app-id}/accounts
You will get all the accounts for the application

Do i need the Facebook PHP SDK for Page Tab Apps?

I'm developing a Facebook Page Tab App. The files are located on my own server and i've created a Facebook App.
Now i'm trying to access the user's first name and i found different ways to get user informations, e.g. the $signedrequest (for the user ID) or the Facebook PHP SDK.
So do i need the SDK, e.g. for Graph API calls, or are there other ways to get informations from Facebook in my Page Tab App?
Using the SDK i get a lot of errors like An active access token must be used to query information about the current user., even if the user is already logged in.
If the user have not signed in to your app you will not get the user name or user id from the singend request parameter. It will give you information if the user likes the page, is admin of the page and additional app_data.
Using the php-sdk you can use the getLoginUrl() method, https://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/, to get the access token needed to fetch user name, user id etc.

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

Is there a way to get the user IDs of all the 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.
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/search?q=user#email.com&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).
GET /v2.10/{app-id}/accounts
You will get all the accounts for the application