Adding admin to fanpage - facebook

I have an app with advanced permission for fanpages.
I was wondering, is there any way possible to add an admin to a fanpage through any API?

It's not possible with regular apps, the app must be whitelisted.
{
"error":
{
"message": "(#100) App must be on whitelist",
"type": "OAuthException",
"code": 100
}
}

Graph api for page
only gives the documentation about fetching admins but there's nothing about adding new admins.
But this should work (though, it gives me "app should be on whitelist" error)
POST admin_id field with valid facebook id to
https://graph.facebook.com/<page_id>/admins,
with a valid page access token (not user access_token)

Related

Facebook graph not give me access for content although I am a group administrator

My web-application need to fetch posts from facebook and save content in pages.
I'm have developer account with business access (authomatically contains permissions pages_read_engagement).
I'm try to get API-key by request: https://graph.facebook.com/v8.0/oauth/access_token?grant_type=client_credentials&client_id=****&client_secret=***
API return me access token and token type:
{
"access_token": "|", "token_type": "bearer" }
After that i try to get feeds via request: https://graph.facebook.com/APP_ID/feed?fields=is_published,id,attachments{title},message,created_time,full_picture&access_token=***&appsecret_proof=***
But API return me error:
"error": {
"message": "(#10) This endpoint requires the 'pages_read_user_content' permission or the 'Page Public Content Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages and https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS for details.",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "AbApv_PjRlplW2Abv61zNCx" } }
I'm trying to get a long-lived user access token, and it worked correctly, but only 60 days and blocked, Then I have to restore it manually.
Account with API is administrator of group and Page read content should work
Support replied that the rights pages_read_engagement will be enough, recommended to change the API version to 10.0, but it did not help. What am I doing wrong?
I tried to use the app key, but it does not work, you need to use the user access token (which has restrictions), or create a system user (which no longer has such restrictions)
I'm create the system user and use his API key.

facebook error Metric requires app admin privileges

I'm trying to access Facebook insights payments_daily_spend with the API with this url:
https://graph.facebook.com/v2.1/APPID/app_insights/payments_daily_spend?since=1403506800&until=1412146800&summary=true&date_format=U&access_token=ACCESSTOKEN
but all I'm getting back is
{
"error": {
"message": "(#3003) Metric requires app admin privileges",
"type": "OAuthException",
"code": 3003
}
}
The app access token I'm using was gotten with an account that has admin privileges for the app, and I can't seem to find any reference to this error anywhere. Has anyone seen this before or know what's wrong?
I finally got an answer by submitting a ticket to Facebook. You need an access token with the read_insights extended permission. You can get it from the Graph API Explorer, but there's probably an API call for getting such a token.

Accessing an application page with facebook graph api

I'm trying to access a facebook page's conversations using the graph api.
Accessing the page itself (with /{page_id}) is fine, but I get on oauth exception for the conversations.
My request in the graph explorer is this one :
/{page_id}/conversations where {page_id} is, well, the page id :)
and the error is
{
"error": {
"message": "(#10) Application does not have permission for this action",
"type": "OAuthException",
"code": 10
}
}
According to the documentation, the required authorization is read_page_mailboxes, which I granted. Here are the rights of my token as shown in the oauth debugger :
public_profile, basic_info, read_page_mailboxes, manage_pages, user_friends
Are there other permissions I'm supposed to require ?
In fact, just asking for the permission itself is not the right way to access to this page informations.
You have to recover the page access token located at /{page_id}?fields=access_token and use this token in order to access the conversations.

Facebook Search API with email address not working?

Trying to do a search through the Facebook API using the search of graph. I know that when logged into my personal email, I can search people via email address rather than their name.
http:///www.graph.facebook.com/search?type=user&q=myemail#email.com
Returns this:
{
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}
}
Although I am using the API explorer which should work.
Any ideas? Is this not available anymore? I found other posts that had it working like this one
Is there a way to do this via FQL?
Facebook API does not allow search user by email.

How to get Facebook Group Albums via Open Graph

https://developers.facebook.com/tools/explorer/?method=GET&path=195466193802264%2Falbums
When I hit that link I get the following error:
{
"error": {
"message": "(#3) App must be on whitelist",
"type": "OAuthException",
"code": 3
}
}
Anyone know how to apply for access to this API?
It means specifically what it says the application must be approved and on Facebook's whitelist. The majority of applications are not whitelisted.
So a possible to accomplish this would be to become a Facebook Trusted Partner.
http://developers.facebook.com/preferredmarketingdevelopers/