Node.js 无法从Facebook Graph API检索具有“ads_read”权限的用户的广告帐户

Node.js 无法从Facebook Graph API检索具有“ads_read”权限的用户的广告帐户,node.js,facebook,facebook-graph-api,facebook-javascript-sdk,facebook-marketing-api,Node.js,Facebook,Facebook Graph Api,Facebook Javascript Sdk,Facebook Marketing Api,我有一个用户可以使用ads\u read权限在我们的应用程序上使用Facebook进行授权,但当我们尝试使用Facebook Graph API上的/adaAccounts edge从该用户的帐户获取广告帐户时,它返回一个错误: { error: { message: "Unsupported get request. Object with ID '<USER_ID>' does not exist, cannot be loaded due to missi

我有一个用户可以使用
ads\u read
权限在我们的应用程序上使用Facebook进行授权,但当我们尝试使用Facebook Graph API上的/adaAccounts edge从该用户的帐户获取广告帐户时,它返回一个错误:

{
  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'
  }
}
{
错误:{
消息:“不支持的get请求。ID为“”的对象不存在,由于缺少权限而无法加载,或者不支持此操作。请阅读位于的图形API文档。”https://developers.facebook.com/docs/graph-api",
类型:“GraphMethodException”,
代码:100,
错误_子代码:33,
fbtrace_id:'A3UCn8GlZiw9s3MRFG8sDUx'
}
}
我在Facebook社区中发现了一个类似的问题,但它来自Graph API版本3。

为什么我无法检索此用户的广告帐户

我使用从Node.js服务器获取的对Graph API的常规GET请求来检索这些数据

      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
      })

fetch(
`https://graph.facebook.com/v10.0/${}/adaccounts?字段=名称、id、帐户\u id和访问\u令牌=${}`,
{
方法:“获取”
}
)
。然后((\u res)=>\u res.json()
。然后((账户)=>{
//…用广告账户做些事情
})

尝试使用
广告管理
权限


根据FB文档,我猜与
/adaccounts
关联的权限是
ads\u management
。而
ads\u read
与阅读Insight API之类的广告报告有关。

我会尝试一下,然后马上给你回复。今天早上醒来时我也在想同样的事情。