facebook业务经理,创建系统用户

oyv*_*ind 3 facebook facebook-graph-api

这可能是一个新手问题,但是我正在努力通过graph-API为我的Facebook业务经理创建一个管理系统用户(和系统用户)。

遵循本指南:https : //developers.facebook.com/docs/marketing-api/businessmanager/systemuser/v2.3#systemuser

发表这样的事情:

  curl \
 -F "name=Ad Server" \
 -F "role=SYSTEM_USER" \
 -F "access_token=<ACCESS_TOKEN>" \
 "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ID>/system_users"
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

{
  "error": {
    "message": "(#3) Business Manager must be on whitelist", 
    "type": "OAuthException", 
    "code": 3
  }
}
Run Code Online (Sandbox Code Playgroud)

我正在一个新创建的业务经理上执行此操作,该业务经理已链接到(公开)Facebook应用程序(列入白名单),并且还具有一个公开页面。我为此服务的公司的业务帐户上有很多活动,因此我将其用作安全的测试环境。我找不到有关如何将业务经理本身列入白名单的任何信息。

访问令牌属于该企业帐户上的管理员用户。我已经尝试使用此令牌对企业帐户执行其他操作(例如提取所有用户),并且效果很好。

首先要这样做的原因是,我需要一个API用户来进行自动的广告系列设置,以管理广告集,自定义受众,广告集和广告。该用户不应直接与任何个人Facebook帐户链接。为此创建一个虚拟帐户似乎是一个糟糕且可能不安全的解决方案。

任何帮助/建议表示赞赏。

小智 5

I have run into the same issue seconds ago. I have tried Graph-API AND Business manager (which seems to be much more comfortable).

Just have a look at: https://developers.facebook.com/docs/marketing-api/businessmanager/faq

Q: What access token is used to create the system user? A: Create the system user and fetch its token using the business manager UI at business.facebook.com, under settings?system user. you'll only see the system user panel if your BM owns and app that has ads-api access, or your owns an app that is specially whitelisted by your FB rep.

This means:

  1. 首先创建您要使用的应用
  2. 将此应用添加到您的业务(也在业务经理中的某处)
  3. 在添加您的管理员用户IP https://developers.facebook.com/apps/<yourappid>/settings/advanced/
  4. 再次尝试创建系统用户

就我而言,它奏效了。