2017-03-03 82 views
0

我使用Facebook的广告API来读取从其他帐户活动。我创建了应用程序,得到了app_id和app_secret。在图形浏览器中,我使用其他人的访问令牌和帐户ID来获得他的竞选。但Facebook给我以下错误:Facebook广告API - 读取其他帐户活动

{ 
    "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 

然而,当我使用Facebook广告API的Python: 我收到以下错误:

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() 

我在哪里出错了?请帮助我

+0

对于第二个问题:http://stackoverflow.com/questions/18683421/why-do-i-get-invalid-appsecret-proof-provided-in-the-api-argument – CBroe

回答

0

最有可能的,您提供的不属于应用程序ID或者您正在使用不属于合适的应用程序的访问令牌的应用程序的秘密。

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

0

如果你仍然需要它 - 在资源管理器中,您一定没有选择该应用程序。这是在右上角。默认情况下,它设置应用图形API资源管理器中,单击下拉菜单,并选择您的实际应用。

干杯!