I have a server side app with an access_token created using the facebook apps appKey and secret.
I use version 2.5 of facebook graph API and cannot use an older API version.
I want to get periodically stats on posts. The posts where created via the same facebook app but with the Facebook users logged in. So in my db I've got the userid_postid for each post.
If I query with the apps id and a posts id I get the expected results for some posts.
GET "{appKey}_{PostId}?fields=shares
If I query like this 'GET "{postingUserId}_{postId}?fields=shares' with the user id and the post id I get this error:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "AyT8LYQDlDd"
}
}
A cron runs periodically a query to get number of likes and shares and it uses the appId and secret to get its access_token.
How do I query for informations on posts?
Related
This is in regards with the Facebook User Profile API (https://developers.facebook.com/docs/messenger-platform/identity/user-profile/). Previously I was able to access details of all the users who messaged our FB Messenger Bot using their USER_ID. But since a couple of days, I'm not able to access details of all the users. I'm only able to access details of few of them.
Example: This User (3200103453356504) regularly texts me, so accordingly to the documentation and how it used to work previously, I should be able to access his information but when I try to access it. It shows the following error:
{
"error": {
"message": "Unsupported get request. Object with ID '320010123356504' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "AFARcLffkfOE55crL3qvJAL"
}
}
But this behavior does not exist for all the users. For ex, For this User ID - 2238372056224053 - its working perfectly fine and returning the correct response with first_name, last_name etc.,
Can you please point out what exactly is the issue.
Thank you,
Murtuza
I need to know If I need to give up on Facebook and just use Twitter for my purposes (if so, just tell me to use Twitter). I want to use pages I don't own.
I am doing this same process in Twitter, but Twitter doesn't have pages that rate places, services or things in general with comments and a rating system (or atleast the ones I need from one city with specific places).
Twitter has much more liberty to get comments from any #user_name but its not good enough for a sentiment analysis specific assignment I need to do. I am trying to get facebook comments or posts from multiple facebook pages (pages from restaurants) based on the comments used for ratings and download them to a csv or database with any program or by coding (Preferably Node.js, javavascript or php) for sentiment analysis (this is very easy with Twitter!). How can I achieve this with all the policies and restrictions Facebook has in 2018??
I have some questions with reference to facebook:
Will an app_id and app_secret by making an app in 2018 give me an access token to get the comments I need from ANY page and download them with graph api?
Is facebook graph API the only way to get comments or posts to download them?
Why doesn't any type of code or programs before and even right now in 2018 work anymore to get comments? (I get the errors below with either programs or graph api).
I tried to use Graph API from facebook for 2 different pages using GET and POST and I get some errors that I didn't have trouble with 9 months ago (this happens with every page I try to search with code in node.js, javascrip, php or the graph API from facebook):
GET/v3.1/OMENbyHPLatam/feed
{
"error": {
"message": "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "CXg962vUvjY"
}
}
POST/v3.1/minecraft/feed
{
"error": {
"message": "(#200) Requires either publish_to_groups permission and app being installed in the group, or manage_pages and publish_pages as an admin with sufficient administrative permission",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "EZvhzuk/UHL"
}
}
I have a facebook app and I have publish_actions allowed for the users registered.
I have created a facebook post on some test wall: https://www.facebook.com/permalink.php?story_fbid=189793004799930&id=100013076942056
I took the object id: 189793004799930 and made a request with a user access token to post a like on his name according to this api reference: https://developers.facebook.com/docs/graph-api/reference/v2.8/object/likes
I am getting the error: "invalid_request" "(#12) singular statuses API is deprecated for versions v2.4 and higher.
If I take the user id and the post id (100013076942056_189793004799930) as mentioned here: How should we retrieve an individual post now that /[post-id] is deprecated in v2.4?
I get the error: invalid_request" "(#100) Story does not exist or user does not have permission to interact with it even though i have permissions
Update
this is the permissions I have for the user: This is the scope I ask publish_actions,email, is this suitable with user posts? or page posts?
You may only like page posts and not user posts with the given permissions.
I tried using the Facebook Graph API for searching Facebook public posts. Since it is depreciated for v2.6, I tried the following command as given as an answer in this post:
https://graph.facebook.com/v1.0/search?q=my_search_query&type=post&access_token=my_access_token,
but gives the following error:
"error": {
"message": "(#11) Post search has been deprecated",
"type": "OAuthException",
"code": 11,
"fbtrace_id": "AwAxoS4unJR"
}
} So it seems that I cannot do Post search any longer on Facebook Graph API. Moreover, I tried using the Public Feed API, but I get the following message on their API page:
Access to the Public Feed API is restricted to a limited set of media publishers and usage requires prior approval by Facebook. You cannot apply to use the API at this time.
Thus, in order to get the data of public posts, I can think of only these two options:
Collaborate with these companies to get the post data
Scrape the Facebook website
Since I do not have enough budget to collaborate with some company, and I want to keep the scraping option at the end, is there any other option of getting public posts of Facebook?
Scraping is not allowed on Facebook: https://www.facebook.com/apps/site_scraping_tos_terms.php
The only option is to collaborate with media partners.
The question raises because I was reading a book about Facebook Application development and when it explains how to make call to the graph, it says that I can verifiy how simply I can retrieve informations from the graph just writitng https://graph.facebook.com/myProfileId in my web browser. Well, I do that but I get this
{
"error": {
"message": "(#803) Cannot query users by their username (myusername)",
"type": "OAuthException",
"code": 803
}
}
but then if I include in the url an access token generated from the Graph API explorer, I can see the JSON with more informations, as I expected to be.
The question is: do I always need an access token to make a request with the Facebook Graph API even if the informations that I want to access are public? In case of affirmative answer to this question, why the book I'm reading says I can get informations from the graph even without an access token? Maybe this is a feature of an older version of the graph api?
Of course you need a token, the token is intrinsically linked to a specific user.
How could you retreive any informations (even public) with only a generic Url,
you must add to the request an information to identify the user that you want.
Personally I use this link "https://graph.facebook.com/me?access_token=" from the facebook doc : https://developers.facebook.com/docs/graph-api/overview