I am going insane...
After Googling, searching here and pulling each of my hairs out one by one, I'm stuck.
I am trying to automate posts to a Facebook page and am calling the following:
https://graph.facebook.com/oauth/authorize?client_id=XXXXXXXX&scope=publish_actions,publish_pages,manage_pages&redirect_uri=http://www.example.com
Followed by:
https://graph.facebook.com/oauth/access_token?client_id=XXXXXXX&redirect_uri=http://www.example.com&client_secret=XXXX&code=XXXXXX
This successfully gives me the access token, but when I try to use the Graph API explorer to post to the page (of which I am an Admin), I get the following error:
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200
}
}
I've tried different permissions, different roles for page users and about everything else I can think of! Could anyone shed some light on this? I'm at my wits end.
Can you try page access_token for facebook page publishing, not user access_token.
https://graph.facebook.com/v2.3/me/accounts
Related
I have an element on my website which shows facebook posts from a page and the amount of views/likes/comments. This stopped working all of a sudden and I have no idea why.
If I make the request with the graph api tester tool I get:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "CIHVxFhXIv/"
}
}
This is the request link I use with file_get_contents:
https://graph.facebook.com/v3.0/idofmypage/posts?fields=comments,full_picture,likes,message,picture,story,permalink_url,updated_time,from,insights.metric(post_impressions)&access_token=myaccesstoken
Did something change again with permissions or maybe a field is deprecated?
According to this fb new the Pages API and others have changed, and now you can only access the data if it's a page of your own.
Pages API: Until today, any app could use the Pages API to read posts or comments from any Page. This let developers create tools for Page owners to help them do things like schedule posts and reply to comments or messages. But it also let apps access more data than necessary. We want to make sure Page information is only available to apps providing useful services to our community. So starting today, all future access to the Pages API will need to be approved by Facebook.
Today I've started a project wich, in the begging, I need to recollect data and that's what I've found about it..
I am testing the facebook graph API comments
https://developers.facebook.com/docs/graph-api/reference/v2.12/object/comments
I checked my permission for the access token it contains the permission, which required by API. see the screenshot
I test my object-id (1797963943566411_1975256375837166) which is correct see me screenshot
Change the request method to POST and adding post data {"message": "haha"}
I get the error message shows:
"(#3) Publishing comments through the API is only available for page access tokens" see my screenshot
As you can see the first step checking, I have all the permission that the
API required.
Can any one see any sort of error in this process?
Try another way still not work.
I have a user who post a photo on his own facebook page.
I logged in with this user and give this user all permissions see the screenshot
enter image description here
call /me/accounts to get page access token
enter image description here
copy the page access token into the Graph API Explorer's access token field
call
GET: 1797963943566411_1975256375837166/likes
is working fine
But call POST: 1797963943566411_1975256375837166/likes
Get error response:
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "GtEaBfyXrUD"
}
}
The reason is Facebook changed the API behaviour. We are no longer to use api to like any POST on our time line. API can only like or comments on facebook page. Sad face !!!!
I am having a problem with the facebook graph API, when I try to read a Page feed using graph../{pageId}/feed it works only for some pages. On other pages I get the following error:
{
"error": {
"message": "(#200) Requires extended permission: ads_management or manage_pages",
"type": "OAuthException",
"code": 200
}
}
The Page is restricted by location, as we found out in the comments. If it works for one user, most likely the other one is not allowed to view the page - which means that you can´t grab the feed with his User Token. The Page could also be unpublished, but i guess that´s not the case.
If you are unsure, try lifting the restriction and test it.
If that does not work, you should file a bug.
When I submit a get on Graph API Explorer, like that:
me?fields=tagged_places
Works good and return the data of my 'tagged places' to me.
But when I try to get 'tagged places' of my friends, I got this error message:
"error": {
"message": "(#100) Unknown fields: tagged_places.",
"type": "OAuthException",
"code": 100
I want to know if is not possible to get 'tagged_places' of my friends or Im doing something wrong.
You need to have the permission of the item you were tagged in.
Take a look at this answer.
Kindly note that the field 'tagged_places' is only accessible on the User object after the user grants the 'user_tagged_places' permission.
This means
1. Your app should request for the 'user_tagged_places' permission during login
2. Your friends should approve of this request while signing into the app.
Hope this helps!
I am using facebook Graph API to get user data with the below query
https://graph.facebook.com/search?q=xxx yyy zzzz&type=user&access_token=myTokenHere
And the reply is;
{
"error": {
"message": "(#9) Access denied",
"type": "OAuthException",
"code": 9
}
}
And also it makes my account to logoff from developer.facebook.com. When I try refreshing that web site it says I am logged out.
I am used to use this account for making this search, this happened suddenly. I made maybe a thousand successful search with this link, with this user with this query.
It doesn't says I am limited or something.
I googled it a lot and made a lot of research but couldn't find any solution to it.