如何编写嵌套的图形API请求 [英] How to write nested Graph API request
问题描述
我正在尝试创建嵌套的FB Graph API请求以获取公共事件的图像。
这个要点给出了完整的JSON对象:
请参阅
I am trying to create nested FB Graph API request to get images for public event. The full JSON object is given at this gist: https://gist.github.com/ZeKoU/be92b88440a6ca3d6be3
What I am trying to do is to get only data.0.images object, i.e. I want to get first object from data , then to get images array, and then to pick some fields from there (source for example).
However, all my attempts (see picture below) are returning only two fields for each object inside data field.
Not sure what you're trying to do, but from what I understood the query
/310897782446456?fields=photos.fields(id,images{source}).limit(1)
should be an example of getting the first photo, extract only some fields from the object (id
and images
for example), and then get a single field (source
for example) from the images array's objects.
See
这篇关于如何编写嵌套的图形API请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!