Cannot get Facebook ads_management extended permission - facebook

I'm trying to get statistics on my facebook ad campaigns. I've followed Facebook own guide, and I've created an app and so on. However I'm unable to get ads_management permission. If I use the Graph Explorer and its "Get Access Token", I cannot select ads_management under extended permissions, the option is simply not there.
I've also tried just sending a request to the Facebook api as follows:
https://www.facebook.com/v2.0/dialog/oauth?client_id=MY_CLIENT_ID&redirect_uri=MY-REDIRECT_URI&scope=ads_management&response_type=token";
Which does get me a access token, but not one with ads_management permission
Any thoughts?
Edit: My app is not whitelisted, but unless I've misunderstood the guide, it does not have to be, as long as I'm a developer on the app, is this correct?

From what I understand of the Facebook Ads API guide is that the ads_management extended permission is only granted to whitelisted apps. So if the Graph endpoint you're hitting requires that permission then you'll have to get your app approved. Check out the getting started overview https://developers.facebook.com/docs/reference/ads-api/overview

Related

Permission to get events from Facebook Page

I am attempting to get events from a specific page, through a person who is administrator of the site and the host of the events. This will not work unless i make the administrator a tester on my Facebook App. Anyone who knows which permission i am missing?
I have the following permissions already:
business_management
manage_pages
public_profile
publish_pages
user_friends
EDIT
Facebook API Explorer
Facebook API Explorer
Access Token Info
https://developers.facebook.com/docs/graph-api/reference/page/events:
This is a restricted edge. You cannot request access at this time.
Facebook has restricted this to specific partners; as a normal 3rd-party app developer you can not get page events at this time.

Error on posting on behalf of a Facebook page

I have an app that programmatically make post on a configured Facebook Page.
My app obviously have both the manage_pages and publish_pages permissions approved and I'm using pages access token
Everything work well since now, but recently when I POST on page feed
https://graph.facebook.com/v3.1/234002440799692/feed
I get this error:
{"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":"HEVcI\/Tq3fW"
}}
I know that Facebook has deprecated publish_actions scope, so that it's not possible anymore to post programmatically on the personal feed, but I can't find out why the post on a page return this kind of error.
Some further infos:
posting with a developer account actually work
the user by which the page access token is obtained, created the page on Facebook (so I think it's an admin for the page)
i recently migrated from graph_api v2.12 to v.3.1
Any suggestion will be appreciated
Thanks
I figured it out what the problem with some pages is.
It seem that now, if the user grant the manage_pages and publish_pages permission, that will be valid only for already existing pages!
New pages haven't the permission granted by default.
The only way I can fix the problem was to remove my app from the user profile (Facebook Settings > Business Integrations > Select the app > Remove) and then prompt the user again with the Facebook OAuth permission dialog.
I don't know if there is a way to force the app removal programmatically, but I can't find out.
You can use the following URL:
https://graph.facebook.com/v7.0/234002440799692/feed?&access_token={access_token}

Unable to post to facebook page using app token

I am building my first facebook app and am facing a issue.
Task : Build a entirely server side application to be used by the admin of a facebook page to post videos/photos on the page. This should not involve having the admin to log in everytime to generate the user acess and page access token.
What I found : Based on the requirement, I found that app tokens can be used for this purpose. This line specifically hints at the usefulness.
App access tokens can also be used to publish content to Facebook on behalf of a person who has granted an open graph publishing permission to your application
I think that using this will be safe since mine is an entirely server side app.
Problem The docs say that:
GET /oauth/access_token?
client_id={app-id}
&client_secret={app-secret}
&grant_type=client_credentials
will give the app token that can be used in place of user access token.
However, I have not been able to do so. Specifically the error encountered is
Error 200 .The user must have accepted the TOS. Since I have already tried publishing content with page access token, I know this is a permission issue.
The following line
a person who has granted an open graph publishing permission to your application.
does not clarify everything. I came across a related question, but the answers seem to be a bit vague.
It would be really great if someone could give me insights about how this can be achieved.
In order to post to a page, you need at least authorize with the manage_pages permission. If you want to post "as user", you need to add publish_actions and use a "User Access Token". If you want to post "as page", you need to add publish_pages and use a "Page Access Token".
Information about how to generate those Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
The error message with the TOS has been discussed a lot of times already, please go to those threads (or find a lot more with the search function):
(OAuthException) (#200) User must have accepted TOS on C# - Facebook
How come I get a "must have accepted TOS" error for test users with app installed?
facebook long term token "(#200) User must have accepted TOS"
Occassional (OAuthException - #200) (#200) User must have accepted TOS
You cannot post to a Page via an App Access Token. This is clearly stated in the docs at
https://developers.facebook.com/docs/graph-api/reference/v2.3/page/feed#publish
A user access token with publish_actions permission can be used to publish new posts on behalf of that person. Posts will appear in the voice of the user.
A page access token with publish_pages permission can be used to publish new posts on behalf of that page. Posts will appear in the voice of the page.
I'd recommend to use a eternal Page Acess Token, so there's no obligation to renew the User Access Token. Have a look at my answer here:
Post to a facebook page without "manage_pages" permission using php
See
https://developers.facebook.com/docs/facebook-login/access-tokens#pagetokens

Graph API v2.2 : user_status permission is obtained from facebook but still cant get the v2.2/me?fields=statuses data

I have an app & user_status permission is obtained from facebook after its submitted for review. I can get the v2.2/me?fields=statuses data for the App's admin. No other fb accounts are able to get this data. When I login with facebook from my portal, the permissions requested are not shown to the users.
Is the issue related to FB API. I can use the obtained permissions only for the App's admin alone?
Is this issue related to not obtaining consent from the account while logging in from my portal. If yes, what is the method to get this done.
Anyone kindly help me regarding this.
It's all in the docs:
https://developers.facebook.com/docs/apps/review/login#do-you-need-review
...your app's developers will be able to see, and grant, any permission without requiring review by Facebook.
and
People who are listed in your app's Roles tab will have access to extended permissions without going through review (e.g. publish_actions or manage_pages). For example, if you use the Facebook Plugin for Wordpress to publish your blog posts to your Facebook Page or Profile, you do not need to submit for review so long as all your publishers are listed in your app's Roles tab.

facebook ad api access

I want to use the facebook graph api for creating custom audience.
The doc says
For an app to do ad management, a user (including an app developer) must give the app permission. This permission is called the ads_management extended permission.
Any idea how can i get the ads_management permission. Can that be applied to an account or will that need an app creation?
Please share any doc links.
Thanks
Pradeep S
The ads_management permission is available as part of the Facebook Ads API, an API on top of the Graph API that's of restricted use. To use the Ads API and thus the ads_management permission you'll need to have your app approved by Facebook as per the Ads API documentation. The form for requesting Ads API access is at https://developers.facebook.com/docs/preferredmarketingdevelopers/ads-api-access