如何为我的应用程序提供进行AdUser api调用的功能

时间:2016-10-25 08:16:04

标签: python facebook facebook-graph-api

我正在尝试以编程方式创建和管理Facebook广告系列。

以下是我的python代码:

my_app_id = 'MyAppId'
my_app_secret = 'MyAppSecret'
my_access_token = 'MyAccessToken'
FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token)

me = AdUser(fbid='MyFbId')
my_accounts = list(me.get_ad_accounts())
print(my_accounts)

可悲的是,当我运行此功能时,我从以下行收到错误:

my_accounts = list(me.get_ad_accounts())

错误是:

facebookads.exceptions.FacebookRequestError: 

  Message: Call was not successful
  Method:  GET
  Path:    https://graph.facebook.com/v2.8/643866195/adaccounts
  Params:  {'summary': 'true'}

  Status:  400
  Response:
    {
      "error": {
        "message": "(#3) Application does not have the capability to make this API call.", 
        "code": 3, 
        "type": "OAuthException", 
        "fbtrace_id": "H3BFNpSClup"
      }
    }

我曾尝试弄乱一些事情来解决这个问题。我认为可行的一件事是将我的帐户ID添加到Facebook开发应用程序设置页面中的授权广告帐户ID,但这没有帮助。

感谢。

0 个答案:

没有答案