无法从具有' ads_read '权限的用户的Facebook Graph API检索广告帐户 &g



我有一个能够使用ads_read权限在我们的应用程序上授权Facebook的用户,但是当我们试图使用Facebook Graph API上的/adaccounts边缘从该用户的帐户获取广告帐户时,它返回一个错误:

{
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等阅读广告报告相关。

最新更新