我有一个能够使用ads_read
权限在我们的应用程序上授权Facebook的用户,但是当我们试图使用Facebook Graph API上的
{
error: {
message: "Unsupported get request. Object with ID '<USER_ID>' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
type: 'GraphMethodException',
code: 100,
error_subcode: 33,
fbtrace_id: 'A3UCn8GlZiw9s3MRFG8sDUx'
}
}
我在Facebook社区发现了一个类似的问题,但它来自Graph API版本3。https://developers.facebook.com/community/threads/489913344898099/
为什么我无法检索该用户的广告帐户?
我使用一个常规的GET请求到图形API使用fetch从Node.js服务器检索此数据。
fetch(
`https://graph.facebook.com/v10.0/${<USER_ID>}/adaccounts?fields=name,id,account_id&access_token=${<ACCESS_TOKEN>}`,
{
method: "GET"
}
)
.then((_res) => _res.json())
.then((accounts) => {
// ... do stuff with ad accounts
})
请获得ads_management
的许可。
根据FB文档,我猜与/adaccounts
相关的权限是ads_management
。而ads_read
则与Insight API等阅读广告报告相关。