Instagram Graph API-结合使用“业务发现和见解”优势

时间:2019-01-23 10:33:19

标签: facebook-graph-api instagram-api instagram-graph-api

我可以使用以下网址获取与外部用户关联的媒体对象列表

GET(我的IG用户ID)?fields = business_discovery.username(therock){media {标题,儿童,comments_count,like_count,id,media_type,media_url,所有者,时间戳,用户名}}

如何使用上述方法获取外部用户的见解。我确实知道要使用以下网址获取我自己帐户的见解

GET(我的IG用户ID)/ insights?metric = impressions&period = week

当我尝试使用下面的网址获取见解时

获取(我的IG用户ID)?fields = business_discovery.username(therock){insights}}

引发以下错误

{
  "error": {
  "message": "Syntax error \"Expected end of string instead of \"}\".\" at     character 46: business_discovery.username(therock){insights}}",
  "type": "OAuthException",
  "code": 2500,
  "fbtrace_id": "FeWhDF4hOJY"
  }
}

是否可以获取外部帐户的见解?

2 个答案:

答案 0 :(得分:1)

要从FB页面检索见解,您必须提供页面管理员之一的凭据。如果有它们,则无需使用business_discovery端点。如果没有它们,就无法检索见解。

答案 1 :(得分:0)

GET (my IG user id)?fields=business_discovery.username(therock){insights}}

看起来您只是在最后留下了一个额外的}-删除了多余的{media{...}},然后错误就消失了。

(使用(I do this in this way because I'm following and order; If I delete a record then the auto increment field (id) skips 1 value. For example. I delete the id = 340 and then the following record start with an id with a value = 341),您有两个嵌套级别,但是现在只有一个。)