【发布时间】:2013-11-26 23:16:22
【问题描述】:
https://developers.facebook.com/docs/reference/ads-api/adreportstats/
根据文档
time_ranges 时间戳对象数组 {time_start, time_stop} 或日期对象 {day, month, year}。
所以在 Graph API Explorer 中,我将 time_ranges 值设置为
time_ranges=[{"day_start":{"day":1,"month":11,"year":2013}},{"day_stop":{"day":10,"month":11,"year":2013}}]
这会返回一个错误
{
"error": {
"message": "(#100) Please set time_start and time_stop or day_start and day_stop.",
"type": "OAuthException",
"code": 100
}
}
为简洁起见,我删除了上述 URL 的其他部分。我已经尝试使用 date_preset 值并且报告返回数据。
谢谢。
编辑:完整的 URL(没有有效的帐户 ID)
https://graph.facebook.com/act_12345/reportstats?data_columns=["account_id","account_name","campaign_id","campaign_name","impressions","clicks","spend"]&time_ranges= ["{'day_start':{'day':1,'month':11,'year':2013}}","{'day_stop':{'day':10,'month':11,'year ':2013}}"]
【问题讨论】:
-
当时我最终使用了带有 Unix 时间戳的 time_interval。就像graph.facebook.com/act_1234567/…{'time_start':1393142400,'time_stop':1393315200}&time_increment=1 我还没有验证在@Tommy Crush 工作之后发布的答案是否。谢谢。
标签: facebook facebook-graph-api facebook-ads-api