Can a facebook app create an ad for any post of its managed pages? - facebook

I'm working on a application that post messages on facebook pages using the manage_pages, publish_pages roles.
Now we need to boost some of those post using ads. For that reason, we also ask for the ads_management, read_ads roles.
With these roles and the marketing api, we thought that we will be available to create an ad for the page post (with the access token of the page) and using an ad account linked to the app, not to the page (the ad is a reward for posting, so it will be payed by the app).
In our first POC, we get authorization errors when using the access token of the page and the ad account of the app. And this is logic for me: an app cannot allow a page token to use the money on an ad account that does not belong to him/them!
Ok. We changed of approach. Now we use a user token from someone of our organization that have access to the the ad account. Now the marketing api is allowing us to manipulate the account, but this user cannot create ads for the posts of the managed pages because it does not have the Advertiser role on each of those pages!
I think that the problem is that the marketing api does not use application level roles but user roles only ... I'm right?
I'm saying this because our application has all the roles that we need, but of course, our staff don't (facebook users authorize apps, not people from the app's organization).
So, there is a way to use the facebook marketing api using an app that can post and manage ads for that page but that use an ad account that is not related to the page?

The page, for which you want to run ads, will have to add the Ad Account (or respective User account that has access to the Ad Account) as an advertiser to the page. That way, you app will be able to create ads for those pages. Can you confirm that works?

Related

Facebook Business Login From Different Users

I'm trying to integrate the Facebook Login for my app connected a Facebook Business. Under the Facebook Business settings, there are Users, and those users have different access under the Facebook Business. When logging into the app, can those users login with their own credentials and will their "access" in the business be able to be revealed in the API response? I'm trying to set up different access levels within the app based on who logs into from the Facebook Business Users. Is this possible?

How do I get access to my customers account from my facebook app?

I created a facebook app (which is currently in dev stage, hence not approved by FB yet).
I need to get the daily ads insights reports for all my customers, so I need them to grant access for my app (ads_read).
I do not understand and cannot find it in the documentation, how do I get my customers to grant me (my app) access to their ads accounts.
Do I need to setup a Business Manager?
thanks
I tried using app token but it only accesses my accounts
There are two options:
Add them to your App as Test Users, so they can use the permissions without review
Go through review with the neccessary permissions
An App Token does not have any relation to a User, so you cannot even get access to your own Ads with that one. You are probably talking about a User or Page Token.
More information about Tokens: https://developers.facebook.com/docs/facebook-login/access-tokens/

How to publish as a Page without requesting extended permissions from a user?

I have one Facebook App that I only use to authenticate users on a website, get their names and profile pictures.
I also have a Facebook Page related to that same website.
My personal profile is administrator of both the App and the Page. Also the Page is registered as "App Page" in the advanced settings of the App.
I want to publish on the Page from a server using the Graph API and the credentials of the App without the need to ask for extended permissions such as manage_pages or publish_pages from my users because I don't need them (see point 1). I don't want to publish on their page, only on mine.
How do I make my App "administrator" of my Page so that no additional permission is required for the App to publish on behalve of the Page?
I know a quick and dirty solution would be to create another App that would be just used as a gateway between my profile and the Page (I would be the only user of the App, granting all the required permissions). But I would like to avoid having two different Apps.
If you want to publish "as Page" on your Page, you need to authorize your Facebook account with manage_pages and publish_pages and get a Page Token. That is the only way.
You can use an Extended Page Token and store it:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Facebook Ads API: (#10) You do not have sufficient permissions to perform this action

I have facebook app with status Live and available to all users. When I login through this app on my site I get access_token for my facebook user. And with this access_token I can read with Ads API next methods (for my own ad campaigns):
/me/adaccounts
/act_<AD_ACCOUNT_ID>/agroups
But when someone else login on my site (and confirms all permissions) and I get his/her access_token I can't perform second api call. I get this error (#10) You do not have sufficient permissions to perform this action. But I can get account ids. So, first method works, second not. How to fix this?
P.S. Status of app in App details tab is Unapproved (lightblue circle).
P.P.S. After adding that user to app's developers all is ok with second method (adcampaigns).
Your app is most likely in development Tier for Ads API Access
https://developers.facebook.com/docs/reference/ads-api/access#limits
You need to apply for higher levels
Some time its happen when you reach the limit of Marketing API Access.
https://developers.facebook.com/docs/marketing-api/access
Suppose your application have basic Marketing API Access Levels (In Basic, further test, iterate, build an app with up to 25 external accounts.) and you reach limit of ad account. When your new ad account(s) will request Facebook Ads API access then facebook send you mention error response.
To check your ad account(s) and their limit
Facebook APP -> Settings -> Advance tab -> Advertising Accounts section -> Ads Api button
https://developers.facebook.com/apps/YOUR_APP_ID/settings/advanced/

Page admins as admin of app?

I have a Facebook Application in order to manage comments on my web page, allowing for moderation, etc.
I also have a Facebook Page, for the same brand.
Is there anyway of having an Administrator list that is shared between these two objects? So that I can add and remove users from one and they would get/lose access to the other?
There's no way to do this automatically, but you can:
Have a trusted user (admin of the page and app) grant manage_pages permission to [your/an] app
Get the page access token for managing the page - see "Page Login" on this document
Retrieve a list of the other page admins from /PAGE_ID/admins
Use the App Access Token to add those users as developers/admins/etc of the App by posting to the Application's 'Roles' connection
Those users will receive (and must accept) a request to become an admin/developer/etc of the app
Caveat: the users you try to add to the app must be verified accounts (via SMS or credit card) or they can't be ad admin or developer of the app
I'm NOT sure about this, but I never saw such thing available. Probably you'll have to integrate an application to your page that works on this