facebook - custom audience export testing - facebook

We have an app to export custom audiences to Facebook for marketing purposes. The app is in development mode. I would like to setup an automated test to trigger these exports with. I have tried creating new real facebook accounts to do this which works, but they always seem to get flagged and blocked before long. I have also tried the "test users" available under the roles and they work for the oauth step, but they fail with this error as soon as I attempt to export the audience:
Error executing rest api call - {"error":{"message":"(#272) This Ads
API call requires the user to be admin of the application. User is not
admin or developer of this
application.","type":"OAuthException","code":272,"fbtrace_id":"G/93tjhM3pH"}}
Is it possible to setup a facebook account that will not get constantly de-activated and still be allowed to export custom audiences?
Thanks.

Related

How do I successfully submit a Facebook App Review for a server-to-server App?

I've written a Python script to pull performance metrics data from the Facebook Graph API for a connected Instagram Business account. It's a script which runs locally and uses my account's credentials.
I've submitted an App Review selecting "No" and "App doesn't use the Facebook Login dialog." for the "Is a Facebook reviewer able to access or login to your app to verify you're using permissions or features according to Facebook Platform Policy?" and "Why isn't a Facebook reviewer able to access or install your app? Select the option(s) that best describe the functionality of your integration." questions.
However, it's been rejected with the following reason given:
"We found that your app's test credentials did not allow us to fully review the content of the app or there were no test credentials provided for us to review. If your test credentials do allow access, check that the account is setup properly to provide us with full access and to allow us to reproduce the use case steps."
I followed the steps from the Server-to-Server App Sample Submission. I've explained why each permission is required and uploaded a screencast of accessing the relevant endpoints.
Is there something I'm missing?

How to subscribe facebook test pages to facebook apps webhook

I am creating chatbot and want to connect on facebook.
I want to test my messenger chatbot in my page, but I must do app review and business verification first and I don't want to do that since I just developed my chatbot (or you can say this is staging environment).
I found that we can create test users, test pages, and test apps. I already create them all, but I cannot find a way to subscribe webhook from my test app to my test pages.
only real page appear in that select a page box.
How to subscribe my webhook to my test page? or is there any other way I can chat to my pages to test my chatbot without using business verification first?
Unfortunately, Facebook test apps / test pages / test users is buggy and seem to not work as expected. (I spent a few hours trying to figure that out)
They seem to focus on real user accounts.
We do not need to do business verification when Status of the app is: In Development
HINT: You can create a real user account in Facebook with any anonymous "false identity" name - so that your identity feels more anonymous and all the pages attached to it - whether published or not. (RISKS: But do not forget your password for this FB account, as you will not be able to recover this "second" FB account, as they might require your passport with that false identity "name" for recovery)
Then - you can create page by admin from real app in Facebook for Developers: Settings -> Advanced -> App Page -> Create Page
And then - just connect your bot to Webhooks in a standard way.
I struggled with this all day. Hopefully this can help someone out.
Here are the steps I took to get the interaction from a test user -> test page -> chatbot to work:
Create a test user within your developers.facebook App Dashboard (Roles, Test Users)
Login with the test user and create a page (Test Users -> Edit -> Login with this test user)
Get a long-lived page access token that has the scopes:
pages_messaging
pages_show_list
pages_manage_metadata
pages_messaging_subscriptions (this is needed to register the webhook)
Use the page access token to programmatically register a webhook for the test page (don't think you can manually add from the dashboard):
POST to https://graph.facebook.com/v9.0/{testPageId}/subscribed_apps?subscribed_fields=messages,messaging_postbacks&access_token={longlivedPageAccessToken}
note: using graphAPI 9.0 for all requests

Facebook Ads API Application does not have the capability to make this API call

I see several other questions with similar descriptions but as far as I can tell my situation is different. I'm trying to make a Marketing API call to this url:
https://graph.facebook.com/v2.11/{act_id}?fields=campaigns.limit(100){name,created_time}
I am using an access token that has been granted these scopes: read_insights, manage_pages, pages_show_list, ads_read, public_profile
The account id in this case has been added to FB Marketing API settings for this test version of my app (and even the production one to be 100% sure). The FB user has also been added as a tester.
This API call works fine in the vast majority of cases, but in certain scenarios I'll get a Application does not have the capability to make this API call error. If I log in with my own account everything works fine. In testing with my wife's FB account I get this error every time. It looks like any FB user has a default ads account called by their name and that's the one I'm trying to make the API call to.
I'm pretty stumped here, any help would be much appreciated.

Facebook marketing api: Is is possible to manage custom audience for a client?

I have to integrate facebook custom audience apis with my application which handles users fb marketing.
After I log the user in to get the access token with all the relevant permissions like ads_read,ads_management and business_managment.
I am getting an error while trying to fetch the custom audiences for the client
type: OAuthException, code: 272, message: (#272) This Ads API call
requires the user to be admin of the application. User is not admin or
developer of this application., x-fb-trace-id: H6HzozvlbXp [HTTP 400]
Am I missing something in this or does facebook not allow for such a scenario or is it because the app is in development mode.
P.S I did try to add another admin https://www.facebook.com/ads/manager/ but no option for an app in the same.
While in development mode, you'll need the users to be admins of your app. Go to developers.facebook.com, select your App from the drop down on the top right. Click Roles on the menu on the right. Add the user as an admin. You may also need to add the ad account under Settings->Advanced->Authorized Account IDs.

API Integration With Facebook - Testing

I am working on API Integration Tests. In particular, I am trying to test the user's ability to login to our application with Facebook. Prior to signing in with our API, the user must sign in with Facebook on the front end of the application via the steps listed here. Since the tests going to be backend integration tests, I would like to handle the entire login in flow solely by leveraging Facebook's API. I can't seem to find any docs that illustrate a methodology to do what the these docs allow the front end to do. Does anyone have en experience with Facebook's API, and know how to simulate the login flow without actually using the login dialogue window?
Sign In Steps
Log in to Facebook
Log in to our API with Facebook returned authentication credentials and redirect uri
Their test user capability should help: https://developers.facebook.com/docs/apps/test-users
It'll allow you to create & sign into a test account, then destroy it afterwards. It won't be limited to normal login & visibility restrictions either.