insufficient_scope unable to post to a page as an admin - facebook

I have a Facebook app currently in Development (the status of the app) in which I am an Admin on and I have two Pages, which I am also an Admin on. My understanding is that when in development, if you're an admin on a page you're able to post to that page.
I've gone through the oAuth flow and have received an access_token. I have the following permissions:
{
"data": [
{
"permission": "email",
"status": "granted"
},
{
"permission": "manage_pages",
"status": "granted"
},
{
"permission": "pages_show_list",
"status": "granted"
},
{
"permission": "publish_pages",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
}
]
}
However, when I try to post to a particular page I'm an Admin on using ${PAGE_ID}/feed, I receive the following:
(#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"
Any idea what could be causing this or if there's some "weird" setting I may have overlooked? Thank you!

Related

Unsupported get request. Object with ID '{USER_ID}' does not exist, cannot be loaded due to missing permissions, or does not support this operation

I am getting this from Facebook webhook. I am trying to get the sender's name and profile picture.
<pre>
{
"object": "page",
"entry": [
{
"id": "172916740162087",
"time": 1609667491,
"changes": [
{
"value": {
"from": {
"id": "2529118547136023",
"name": "Md Abid Hasan Nayem"
},
"post": {
"status_type": "added_photos",
"is_published": true,
"updated_time": "2021-01-03T09:51:29+0000",
"permalink_url": "https://www.facebook.com/CodeWareLTD/posts/851154192338335",
"promotion_status": "inactive",
"id": "172916740162087_851154192338335"
},
"message": "Happy new year",
"post_id": "172916740162087_851154192338335",
"comment_id": "851154192338335_853191445467943",
"created_time": 1609667489,
"item": "comment",
"parent_id": "172916740162087_851154192338335",
"verb": "add"
},
"field": "feed"
}
]
}
]
}
</pre>
When I am sending request with the user id /{USER_ID}?access_token=token then it's returning this error.
Whereas I have all the required permissions approved.
<pre>
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "ABtpgYvcMuaA_jQcW8Fdi3M"
}
}
</pre>
I opened a bug report, but they told me it's ok as per the current Facebook system design. But
still, I'm unable to get the user's first name, last name, and profile picture.
Bug Report Link: https://developers.facebook.com/support/bugs/887826828623849/.
Please, help me to get the exact API to get the sender's name & profile picture.
my currently successfully reviewed permissions are:
email,
pages_manage_metadata,
pages_read_engagement,
pages_show_list,
pages_messaging,
pages_read_user_content,
public_profile,
pages_manage_engagement,
pages_manage_posts

facebook javascript api gives error on post like "(#3) Publishing likes through the API is only available for page access tokens"

I am trying to like a post using post id and access token.
Below is code for post like:
FB.api("/"+feed.id+"/likes?access_token="+$rootScope.fbAccessToken, 'post',function(response) {
console.log(response)
if(response === true) {
alert("done!");
}
});
I have checked my access token permissions with URL:https://graph.facebook.com/me/permissions?access_token=ACCESS_TOKEN
Below are access token permissions
"data": [
{
"permission": "user_about_me",
"status": "granted"
},
{
"permission": "email",
"status": "granted"
},
{
"permission": "manage_pages",
"status": "granted"
},
{
"permission": "publish_actions",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
}
]
}
It gives me javascript error:
error: Object code: 3 fbtrace_id:"AWj/2RCyzbz" message:"(#3)
Publishing likes through the API is only available for page access
tokens" type:"OAuthException"
I am not getting how to like a post using javascript api. Please help in this issue.
Facebook restricted this feature's access. Users can no longer like posts. Now you can only do it if your token is a page type. More info in:
https://developers.facebook.com/bugs/1754734484744033/

Facebook API - Unsupported get request for Test Users

This problem seems to coincide with facebook's API version change.
When I call
https://graph.facebook.com/{album-id}/photos?access_token={access_token}
I expect it to return the photos in the specific album. This works when I use my own facebook account or a friends. However when I try to use a test user set up in facebook I'm now getting
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
I've tried specifying the version number
https://graph.facebook.com/v2.3/...
Can someone explain why this call no longer works for test users and still works for 'real' users? I can make the previous '/me/albums' call without any errors on both real and test accounts.
These are the permissions for the test user...
{
"data":
[{
"permission": "user_birthday",
"status": "granted"
},
{
"permission": "user_photos",
"status": "granted"
},
{
"permission": "email",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
}
]}
Any ideas?
Thanks.

posting to Facebook error: '(#200) The user hasn\'t authorized the application to perform this action', type: 'OAuthException', code: 200

When i try to post something via facebook from my application i get the following error, the problem is that the application didn't ask for publish action permission
Here is the code
var access_token = 'access_token'
FB.setAccessToken(access_token);
var body = '2 4 6 8 8.5';
FB.api('me/feed', 'post',{ message: body, access_token:access_token}, function (res) {
if(!res || res.error) {
console.log(!res ? 'error occurred' : res.error);
return;
}
{ message: '(#200) The user hasn\'t authorized the application to perform this action',
type: 'OAuthException',
code: 200 }
And i have another question
whaat access token should be used
the user's access token , the application access token or what ?
You'll need the user to allow the publish_actions extended permission to allow your app to post to Facebook.
See the publishing section to the me/feed reference: "A user access token with publish_actions permission can be used to publish new posts". The user needs to be prompted "are you ok for this app to post to Facebook" and accept for this access token to work.
Note that it's good practice to check the user's permissions before trying to publish, which you can check by looking at the me/permissions endpoint:
{
"data": [
{
"permission": "installed",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
},
{
"permission": "publish_actions",
"status": "granted"
},
{
"permission": "user_friends",
"status": "granted"
}
]
}
You can get this data by running:
FB.api("/me/permissions", function (response) {
// data here
});
To ask the user for the permission, you need to add "publish_actions" into the scope when running the FB.login dialog:
FB.login(function(response) {
// handle the response
}, {scope: 'publish_actions'});

Permissions to get comments of post user is tagged in on facebook

I'm attempting to do some analysis of a user's Facebook data, so I'm attempting to collect as much as possible. Using the Facebook graph api, which permissions do I need to request in order to get the comments for a post the user is tagged in. If the post is on the user's wall, it isn't a problem, but if the user is tagged in a post on a friend's wall no comments are there, and the count is set to 0.
I'm making a request to //feed with what I believe to be a valid access token from my application. However, using the graph explorer tool from Facebook the same situation happens. I assume the problem is a permission I am missing, but can't seem to figure out which one I should add.
I'm currently requesting the following permissions:
friends_photos
friends_likes
friends_checkins
friends_status
user_photos
user_likes
user_checkins
user_status
read_mailbox
read_stream
{
"id": REDACTED,
"from": {
"name": REDACTED,
"id": REDACTED
},
"to": {
"data": [
{
"name": REDACTED,
"id": REDACTED
}
]
},
"message": REDACTED,
"message_tags": {
"121": [
{
"id": REDACTED,
"name": REDACTED,
"type": "user",
"offset": 121,
"length": 11
}
]
},
"privacy": {
"value": ""
},
"type": "status",
"created_time": "2013-03-13T14:25:44+0000",
"updated_time": "2013-03-13T14:25:44+0000",
"comments": {
"count": 0
}