5

Background

  • I'm building an Ads-Management application tailored towards both marketing / advertising agencies and individual advertisers (users)
  • To test marketing-api, I have setup a SandBox ad account

The very first thing that I'm testing is creating and uploading of custom audience (CSV file upload) and sharing it across ad accounts owned by different BusinessManagers.

From what I've gathered thus far, creating custom audience has 2 steps


For creating an empty Custom audience I follow using the cURL request from docs

curl -X POST \
  -F 'name="My new Custom Audience"' \
  -F 'subtype="CUSTOM"' \
  -F 'description="People who purchased on my website"' \
  -F 'customer_file_source="USER_PROVIDED_ONLY"' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v7.0/act_<AD_ACCOUNT_ID>/customaudiences

This gives me

{
    "error": {
        "message": "Permissions error",
        "type": "OAuthException",
        "code": 200,
        "error_subcode": 1870050,
        "is_transient": false,
        "error_user_title": "Business Account Needed to Create/Edit This Audience",
        "error_user_msg": "To create or edit a Custom Audience made from a customer list, your admin needs to add this ad account to a business.",
        "fbtrace_id": "AsMXXXXXXXXXXXXXX-fXXXX"
    }
}

What have I done already

  • Added my App (Test-App-1) to my BusinessManager (Test-Business-1)

    Admin System User created in BusinessManager

  • Followed this discussion and added a Admin System User (Test-Admin-System-User-1) generated from my BusinessManager to my App

    Added App to BusinessManager

  • Generated access token (with all ads / business related permissions) for my Test-Admin-System-User-1 to use in API calls

    Access token for Admin System User generated

  • Click on Connect to Business on my SandBox Ad Account and used Test-Admin-System-User to link it with my Test-Business-1 as told here

    SandBox ad account Connect to Business


Where am I stuck

(in addition to the above mentioned error in API response)

  • Despite having done above mentioned things, the BusinessManager continues to say that my request for adding my sandbox ad-account (as identified by it's account_id) is still pending

    Request for adding Sandbox ad-account is pending

  • And when I try to forcibly redo it, it tells me that

    Your business has already sent this request. To follow up on the request, contact the business you're requesting access from.

    Can't re-add Sandbox Ad-Account to BusinessManager


I must add that I didn't face the issue of having to accept Terms of Service

In other words

  • I'm not 100% sure if I've accepted terms of service
  • But since the error I get is different, my best guess is that I must've done it at some point of time (can't recall though)

My questions are

  • Immediate question: How can I accept the request for adding my Sandbox ad account to my BusinessManager?
  • Main question(s)
    • where am i going wrong (understanding gap)?
    • How to test uploading and sharing custom audience using Sandbox Ad Account
y2k-shubham
  • 10,183
  • 11
  • 55
  • 131
  • Here's the [link](https://developers.facebook.com/community/threads/259494278572008/?post_id=259494281905341) to my question on [Developer Community Forum](https://developers.facebook.com/community/) – y2k-shubham May 11 '20 at 13:04
  • Hello, did you manage to add sandbox ad account to system user in the end? if so, how did you do it? Thanks :) – Artur Shyshko Jun 30 '22 at 06:20
  • @Artur Shyshko no. Considering the lack of clarity on technical and business front (unclear documentation, support), we found the endeavour to be risky and abandoned the idea altogether – y2k-shubham Jun 30 '22 at 06:27

1 Answers1

0

I found a workaround! You can create Custom audiences through the Marketing API using a real, not Sandbox, Ad account. Here's how to do it:

  1. Create or log in to the Business Manager with an Ad account.

NOTE: The newly created Businesses cannot create Custom audiences from the list of users (Customer list) with names, emails, etc., as they must run some Ads before this feature is unlocked (Facebook doesn't provide information about the exact requirements for this). You can open the Business Manager -> Audiences, then click "Create custom audience" and check that the "Customer list" option is unlocked for this account.

  1. Log in or create a Facebook app on the Meta for Developers portal. Ensure that your Facebook account with access to the Business (from point 1) has an Admin role on this Facebook app.

Normally, a Facebook app must pass an app review to be able to create Custom audiences through the Marketing API. But the Facebook app's Admins can use this API without app review. That's why it is necessary to have an Admin role in the Facebook app.

  1. Integrate the Login API, log in to your Facebook account, retrieve an access token, and exchange it for the long-term access token (according to Facebook's auth docs). With this long-term access token, you can create Custom audiences for a Business from point 1 using Marketing API.