Facebook documents how to get a page access token让您调用Graph API获取所有fb帐户的列表。这是通过发出GET请求来完成的:
https://graph.facebook.com/me/accounts?access_token=USER_ACCESS_TOKEN
然而,这会返回帐户的列表:
{
"data": [
{
"name": "PAGE_TITLE",
"access_token": "PAGE_ACCESS_TOKEN",
"category": "PAGE_CATEGORY",
"id": "PAGE_ID"
},
{
"name": "PAGE_TITLE",
"access_token": "PAGE_ACCESS_TOKEN",
"category": "PAGE_CATEGORY",
"id": "PAGE_ID"
},
...
]
}
我有我想要的页面的fb id。而不是在列表中查找匹配的id,是不是有一个Graph API调用直接获取数据块?我的最终目标是检索页面访问令牌。
答案 0 :(得分:1)
执行此操作,只需更改PAGE_ID和USER_ACCESS_TOKEN
即可https://graph.facebook.com/PAGE_ID?fields=access_token&access_token=USER_ACCESS_TOKEN