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

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/

Related

When do I need to submit my app for Facebook review (when only reduced group of people will use it)?

I am creating an app that only a specific list of users will use, and I need Instagram Public Content Access permission (and some other permissions) for them (I have my Instagram Business Account all set up and connected with Facebook page).
On https://developers.facebook.com/docs/facebook-login/review/examples/#screencast there is stated:
You do not need to submit your app if it will only be used by you or
by a reduced number of people. Any account listed in the Roles tab in
your App Dashboard, such as admins, developers and testers, can access
all permissions and generate a user or page access token.
So I just want to make sure, that it is completely fine in my case to keep my app in development mode and let my users use it like this (so I don't need to submit my app for review as long as all the users are going to have their role assigned in my app), and that these permissions are not intended just for a limited time period or only for testing/development purposes.
Thank you for any answer.
What you quoted there, is applicable to permissions your app is going to ask its users to grant to it.
Instagram Public Content Access is not a permission, it is a feature. You need to get it reviewed, if you want your app to be able to access content that the users of your app do not have admin access to.
https://developers.facebook.com/docs/apps/review/feature/#reference-INSTAGRAM_PUBLIC_CONTENT_ACCESS

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

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?

How to generate Facebook Marketing API access token to use it in Windows application

I am using Facebook as advertising platform to promote my application on Apple and Google stores. I would like to make windows service which will download daily report(s) about advertising status of my marketing campaign running one Facebook, preferably using 60 day token, or some permanent solution so that token is retrieved when required. I think that i understand everything to do this except how to generate access token to use it with Facebook Graph API. Which token for which Facebook account do I need and how to obtain it?
You'll need a Facebook app and to grant that app the ads_read permission in order to retrieve reports about your advertising efforts via the API (source).
You'll want a long-lived token so that you don't have to re-authenticate very often. The access token documentation details the steps to exchange a short-lived token for a long-lived one.
You may also want to consider managing the app, ad account, and access tokens (via a business system user) with the FB Business Manager.
Create a facebook app.
Go to the Graph API Explorer in Facebook's Tools & Support section.
Pick your app from the drop down.
Hit Get Token > Get User Access Token.
In Select Permissions choose required permissions or select them from extended permissions.
Use the user access token that will be presented to you in the access token form input field.

Can I create a second Facebook account for testing without violating the TOS?

I'd like to develop a Facebook app that reads statuses posted by a user's friends. However, it seems that I can only read friends' statuses if they've given the app a user_friends permission. So, to test my app before I actually release it to my friends, it seems I'll need to set up a test account, set up a friend relationship between that account and my account, and then have the test account give the app permission.
Is making a second account for this purpose allowed under the TOS?
Facebook has a tool (and API) for generating test users for your app, which you can find in your app's dashboard's "Roles" tab.
https://developers.facebook.com/docs/apps/test-users#managetool

Facebook app fetching ads reports from business account

I can't figure this out, I hope someone here can point me in the right direction. I've searched for an answer but was unable to find it.
I want to create a Facebook app which would manage ads (download ads reports and statistics). I've got user account, registered as developer, created and whitelisted the app. I've got only Development Access and that means means I can query only ad accounts owned by the admins of the app, set up in the account list associated with your application.
Problem is that the account with ads is a business account so I can't add this account as part of developers team and get the statistics. I get permissions errors when trying to access the business account (I have access token and everything, it just won't let me see the ads data due to insufficient permissions).
Is there a way to do this without applying for Basic access (not sure if I'll get it since the app is not done)? Can't I really somehow connect my developer's account with that business account?
About access limits: https://developers.facebook.com/docs/reference/ads-api/access/v2.2#limits
Seems like this is working correctly - you can build and test the app against accounts administered by your app's admins/developers at first
Once it's working you can submit it for approval to the Basic access level, where you can manage more accounts, including those belonging to users who aren't admins/developers of the app
There's more information about the access levels and how to move between them in the Access levels dovumentation