Facebook广告管理Python SDK返回“GraphMethodException”

时间:2015-08-02 23:57:45

标签: python facebook facebook-graph-api facebook-ads-api

我正在尝试简单地获取广告系列的统计信息。我从文档中将这一点联系在一起:

from facebookads.objects import AdUser
from facebookads.api import FacebookAdsApi
from facebookads.objects import AdAccount

my_app_id = 'xxx'
my_app_secret = 'xxx'
my_access_token = 'xxx'
FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token)

me = AdUser(fbid='xxx')
account = AdAccount('xxx')

params =  {
    'start_date': '2014-09-01',
}

fields = {
    'impressions',
    'clicks',
    'spent',
}

stats = account.get_ad_campaign_stats(fields=fields, params=params)

for stat in stats:
    print stat

我正在找回一个代码:1类型:从API返回GraphMethodException。

响应松散如此:

Message: Call was not successful
Method:  GET
Path:    https://graph.facebook.com/v2.3/xxx/adcampaignstats
Params:  {'fields': 'impressions,spent,clicks', 'start_date': '2014-09-01', 'summary': 'true'}

Status:  400
Response:
{
  "error": {
    "message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", 
    "code": 100, 
    "type": "GraphMethodException"
  }
}

我做错了什么?任何帮助都会很棒。谢谢!

0 个答案:

没有答案