Facebook Graph API not working with comments? - facebook

I created a page and an app with a Facebook Developer account.
In the Explorer Tool, I can retrieve a list of posts with this query without any issues:
104801368572889/feed?fields=message,attachments&access_token=[token]
However, not so lucky when I try to retrieve the comments associated to a post with this query:
104801368572889_105680201818339/comments?access_token=[token]
That's the error I get:
{
"error": {
"message": "(#200) Missing Permissions",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "AOmx5mNZC9xUFysAWp4oX3s"
}
}
It sounds like this means I don't have permissions. I tried to add all the possible permissions in the Explorer Tool (included the pages_read_engagement that is probably the one required for this API call). However, this doesn't seem to work. I also tried to add permissions in the app from the Developer Dashboard, but this brings me into a long process of information requests and reviews by Facebook. I don't want to go through this process as I'm just doing development at the moment. Isn't there something as a sandbox or development mode, where I can set the permissions that I want?

Related

Can't query instagram user with Graph API

Things were working find until yesterday. I'm developing a simple Instagram app, I made a basic login flow. Now, when I try to log in for the app with a business facebook account I get a message "You don't have any Instagram Business Accounts linked to a Page.", which is funny, because in business account manager, in "Instagram Accounts" tab, I have my business instagram account listed; trying to remove it gives me a message: "This Instagram Account can't be removed because it's already linked to an Instagram business profile.". Great, seems like it SHOULD be working. It isn't but, the second part follows.
I generated an access token for that instagram account for Instagram Basic Display API, queried node https://graph.instagram.com/me, I got my account ID in response. Now, I tried to query the user using Graph API - https://graph.facebook.com/17841431928202825 - but in response I get:
{
"error": {
"message": "Unsupported get request. Object with ID '17841431928202825' 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": "AwbBT4_pYZjEg5HbG1UHYPi"
}
}
For this I'm using an access token generated for the facebook account.
Do you have any idea why the hell it can't see my account both querying the API and from Business manager?

Why does facebook’s graph API return a permissions error when I try to get the “owner” of any facebook event that I am personally invited to?

I am using facebook's graph api. The access token I am using is the User's access token, (my personal access token). I am invited to these events personally. These events are public.
When I type /{eventid}/?fields=owner, I get
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "DcJaHySwF7S"
}
}
When I do /{eventid}/?fields=cover or most other fields it works just fine.
I am using the online graph tool v3.3 and tried it on v3.2 as well.
I have also tried this on curl on my personal terminal.
Below is the oath permissions I have set using the Graph API explorer.
Permission's Image
Since you cannot even get the list of Page Events right now (even if you own the Page), I assume it´s not possible: https://developers.facebook.com/docs/graph-api/reference/page/events/
This is a restricted edge. You cannot request access at this time.

How to get overall star rating of Facebook page from Facebook Graph API?

I am trying to make a very simple request to Facebook's Graph API using this URL:
https://graph.facebook.com/v2.12/1984193321812400?fields=overall_star_rating&access_token=205658113371329|gYdP-nDHNVENlwVxria21Uczgs8
All I want from Facebook is the overall_star_rating of my Facebook page. However, this is what I get:
{
"error": {
"message": "(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/206742313468873/",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "A9XRfTkh3WR"
}
}
Since I am completely new to Facebook Graph API: Is the request I am making correct or am I missing something really fundamental here?
And yes, I read Facebook's issue report, but I don't find it very helpful since I set my app to active already and it's not working anyway.
Thanks for any help in this matter.
Since Facebook is undergoing major changes, they have revoked few access to non active apps. Get the access_token from any frequently used app, your Graph API call is pretty correct!
But the Page ID seems to be wrong, as it shows me error after adding a working token.
Error : "message": "(#803) Some of the aliases you requested do not
exist: 1984192327815400"
After changing the Page ID, and adding active app token, it shows the correct result.

Publishing Facebook Open Graph Stories from Backend

When I try to make a POST to https://graph.facebook.com/v2.4/me/<app_namespace>:<action>
with user access_token into body I'm getting the following error:
{
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15
}
}
Why Facebook is asking me for app access_token? I want to publish a story into wall of user specified by access_token, so I really need to use the application access_code?
Check the details of your action configuration in app dashboard. On the bottom, under “Advanced Options”, there is a option “Requires App Token to Publish” – sounds like you have that set to “Yes”.
This option exists to prevent users from “cheating” by publishing actions themselves, by using their user access token for your app – for example if you have a game with an Open Graph story about the user reaching a certain level or amount of points, then you probably wouldn’t want users to be able to publish that on their own, without actually achieving the necessary level/points in your app.

Facebook graph API: simple search for users by name

I would like to do a simple search for users by their name from a desktop application using Facebook's graph API. The result I want to have is a list of user names and the link to their profile. I spent several hours reading the documentation but it is still not very clear to me, which access tokens I would need. I have created a developer account on Facebook and added a new app. I've got an app access token and I've tried to do a search using the following URL:
https://graph.facebook.com/search?q=john&access_token={my_app_access_token}
I got the following response:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
My question now is, if it is possible to do such a simple search without user access token. So the user sitting in front of my desktop application should NOT have to enter his facebook credentials somewhere - never. Can this be done somehow?
When searching, you should provide the search type (in your case user) and to answer your question, no, a user access token is required to search, app tokens won't work for user searches (documented here)