Facebook Graph API - 多次指定字段附件。这只有在 2.1 版本之前才有可能
Facebook Graph API - Field attachments specified more than once. This is only possible before version 2.1
我正在使用 FB Graph API 浏览器和版本 11.0 我添加了页面 ID、提要和字段。以前我们使用 'link' 和 'title' 但根据文档 here 这些已被弃用,这些是新的字段名称:
attachments{unshimmed_url}
attachments{title}
但是当我将它添加到 FB Graph API Explorer 时,我要么得到错误:
Field attachments specified more than once. This is only possible
before version 2.1
或者我只得到第一个提到的附件字段(附件{unshimmed_url})
1234567/feed?fields=attachments{unshimmed_url}&attachments{title}
现在无法重现此错误,使用 v11.0,但是 如果您只列出逗号分隔的子字段,它应该可以工作:
…/feed?fields=attachments{unshimmed_url,title}
https://developers.facebook.com/docs/graph-api/advanced#fieldexpansion
编辑:可以重现,使用“正确的”不正确的语法。
feed?fields=attachments{unshimmed_url},attachments{title}
抛出这个错误;你的 post 中有 feed?fields=attachments{unshimmed_url}&attachments{title}
,这是另一回事 - 这是一个名为 fields
的 URL 参数,然后是一个名为 attachments{title}
的参数
我正在使用 FB Graph API 浏览器和版本 11.0 我添加了页面 ID、提要和字段。以前我们使用 'link' 和 'title' 但根据文档 here 这些已被弃用,这些是新的字段名称:
attachments{unshimmed_url}
attachments{title}
但是当我将它添加到 FB Graph API Explorer 时,我要么得到错误:
Field attachments specified more than once. This is only possible before version 2.1
或者我只得到第一个提到的附件字段(附件{unshimmed_url})
1234567/feed?fields=attachments{unshimmed_url}&attachments{title}
现在无法重现此错误,使用 v11.0,但是 如果您只列出逗号分隔的子字段,它应该可以工作:
…/feed?fields=attachments{unshimmed_url,title}
https://developers.facebook.com/docs/graph-api/advanced#fieldexpansion
编辑:可以重现,使用“正确的”不正确的语法。
feed?fields=attachments{unshimmed_url},attachments{title}
抛出这个错误;你的 post 中有 feed?fields=attachments{unshimmed_url}&attachments{title}
,这是另一回事 - 这是一个名为 fields
的 URL 参数,然后是一个名为 attachments{title}