问题
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" is also not working.
Thanks in advance!
output format:
"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"
},
回答1:
How about flattening request? so from this:
GET /{ig-user-id}?fields=media
should be the same as
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
回答2:
try using the operator "IN" instead of "EQUAL", and be sure to have a list in the value. That might work.
来源:https://stackoverflow.com/questions/57222780/how-does-one-properly-filter-nested-queries-with-fb-graph-api-instagram