如何使用FB Graph Api(Instagram)正确过滤嵌套查询? [英] How does one properly filter nested queries with FB Graph Api (Instagram)?

查看:118
本文介绍了如何使用FB Graph Api(Instagram)正确过滤嵌套查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取所有类型为"VIDEO"的媒体对象. 这是我的查询,无论类型如何,它总是返回所有媒体对象:

I would like to get all media objects that are of type "VIDEO". Here is my query which always returns all media objects regardless of the type:

?fields=media{media_type,insights.metric(reach, impressions)}&filtering=[{field: "media_type", operator: "EQUAL", value: "VIDEO"}]

"media.media_type"也无法正常工作.

"media.media_type" is also not working.

提前谢谢!

输出格式:

"data": [
  {
    "media_type": "IMAGE",
    "insights": {
      "data": [
        {
          "name": "reach",
          "period": "lifetime",
          "values": [
            {
              "value": 1476
            }
          ],
          "title": "Reichweite",
          "description": "Gesamtanzahl der individuellen Konten, die das Medienobjekt aufgerufen haben",
          "id": "18057498358135767/insights/reach/lifetime"
        },
        {
          "name": "impressions",
          "period": "lifetime",
          "values": [
            {
              "value": 2365
            }
          ],
          "title": "Impressionen",
          "description": "Gesamtanzahl der Aufrufe des Medienobjekts",
          "id": "18057498358135767/insights/impressions/lifetime"
        }
      ]
    },
    "id": "18057498358135767"
  },

推荐答案

展平请求如何?所以从这个:

How about flattening request? so from this:

GET /{ig-user-id}?fields=media

应与

GET /{ig-user-id}/media?fields=media_type,insights.metric(reach, impressions)&filtering=[{'field':'media_type','operator':'IN','value':['VIDEO']}]

然后应该没有嵌套值的问题

and then should be no issue with nested value

这篇关于如何使用FB Graph Api(Instagram)正确过滤嵌套查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆