【发布时间】:2016-10-14 08:50:58
【问题描述】:
我正在构建一个 instragram-ads-crawling web 服务。我通过神秘 API 文档中的 REST 请求映射了我的功能方式,并且在大量授权和混合新旧命名约定(例如广告组与广告)之后,我终于设法实现了一个非常重要的调用行为怪异。我解释一下:
首先,为了论证,我做了如下调用:
https://graph.facebook.com/v2.6/<adcreative_id>?fields=comment_count,like_count&access_token=<my_token>
它工作得很好,我得到了这样的东西:
{
"comment_count": 4,
"like_count": 175,
"id": "<adcreative's_id>"
}
当达到创意的 cmets 时,会确定性地发生两件事之一。假设我提交了以下调用:
https://graph.facebook.com/v2.6//cmets?fields=message,created_at,comment_type,instagram_user&access_token=
(1) 当帖子只有标题(API 也将其视为评论)时,它会向我发送一个非常好的回复,例如:
{
"data": [
{
"message": "here goes the actual ad's caption, as written by the advertiser",
"created_at": "2016-04-22T18:36:01+0000",
"instagram_user": {
"id": "0123456789"
},
"comment_type": "CAPTION",
"id": "<actual_comment_id>"
}
]
}
(2) 当帖子有实际的 cmets 时(任何大于零的数字不包括 CAPTION 评论),我总是得到一个空的回复:
{
"data": [
]
}
我仔细检查了我要求用户在身份验证时授予的权限,目前是ads_management、ads_read、page_management 和read_insights。我还检查了我是否已授权相关AdAccount 使用广告 API。最后,我什至验证了我登录的User Account 在我尝试读取的AdAccount 上拥有广告商权限。
【问题讨论】:
标签: facebook facebook-graph-api facebook-ads-api facebook-permissions facebook-marketing-api