gpt4 book ai didi

facebook - FB 图 API : Way to get list of fields for an object through API

转载 作者:行者123 更新时间:2023-11-30 05:21:43 26 4
gpt4 key购买 nike

有没有办法以编程方式获取特定 facebook 对象的字段列表?

我知道有这方面的文档,但我需要一些反省 - 我们正在构建一个工具,使用户能够从现有字段中进行选择。

我的意思是:给我一个用户字段列表,响应:{"id", "name", "first_name", ...}

或者如何获取一个对象的所有字段并从中派生?

最佳答案

Facebook 允许您传递 metadata=1 参数。例如

cocacola?metadata=1

为您提供页面的所有可用连接和字段:

  "metadata": {
"connections": {
"admins": "https://graph.facebook.com/cocacola/admins",
"admin_settings": "https://graph.facebook.com/cocacola/admin_settings"
},
"fields": [
{
"name": "id",
"description": "The Page's ID. No access token or user `access_token`. `string`."
},
{
"name": "name",
"description": "The Page's name. No access token or user `access_token`. `string`."
},
{
"name": "link",
"description": "Link to the page on Facebook. No access token or user `access_token`. `string` containing a valid URL."
},
{
"name": "category_lists",
"description": "The Page's categories. No access token or user `access_token`. `string`."
},
{
"name": "is_published",
"description": "Indicates whether the page is published and visible to non-admins. No access token or user `access_token`. `boolean`."
}

看起来是官方的,在 getting started manual 中找到的

关于facebook - FB 图 API : Way to get list of fields for an object through API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16095115/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com