首页 文章

facebook ads api - 阅读其他帐户广告系列

提问于
浏览
0

我正在使用Facebook广告API来阅读其他帐户的广告系列 . 我创建了应用程序,得到了app_id和app_secret . 在图表浏览器中,我使用其他人的访问令牌和帐户ID来获取他的广告系列 . 但facebook给了我以下错误:

{
  "error": {
    "message": "(#274) The ad account is not enabled for usage in Ads API. Please add it in developers.facebook.com/apps -> select your app -> settings -> advanced -> advertising accounts -> Ads API. Account 1817273581872129 not enabled for this application.",
    "type": "OAuthException",
    "code": 274,
    "fbtrace_id": "GW38TMsIi1v"
  }
}

我确实遵循了错误说明,但仍然存在同样的问题 .

这是我在图形资源管理器中使用的网址:

act_12345566654/campaigns

但是,当我在python中使用facebook ads api时:我收到以下错误:

FacebookRequestError: 

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

  Status:  400
  Response:
    {
      "error": {
        "message": "Invalid appsecret_proof provided in the API argument", 
        "code": 100, 
        "type": "GraphMethodException", 
        "fbtrace_id": "FRdlngO8f04"
      }
    }

这是代码:

session = FacebookSession(self.app_id, self.app_secret, self.access_token)
ads_api = FacebookAdsApi(session)
adaccount = AdAccount(self.account_id, api=ads_api)
campaigns = adaccount.get_campaigns()

我哪里错了?请帮助我

2 回答

  • 0

    最有可能的是,您提供的应用程序密码不属于应用程序ID,或者您使用的访问令牌不属于正确的应用程序 .

    检查以下内容:1)应用程序ID 2)应用程序密码(应该是特定应用程序)3)访问令牌(应该是针对上面指定的应用程序)

  • 0

    如果您仍然需要它 - 在资源管理器中您必须没有选择该应用程序 . 这是在右上角 . 默认情况下,它将应用程序设置为Graph Api Explorer,单击下拉菜单,然后选择您的实际应用程序 .

    干杯!

相关问题