微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

对于已获得“ads_read”权限的用户,无法从 Facebook Graph API 检索广告帐户

如何解决对于已获得“ads_read”权限的用户,无法从 Facebook Graph API 检索广告帐户

我有一个用户可以使用 ads_read 权限在我们的应用程序上向 Facebook 授权,但是当我们尝试使用 Facebook Graph 上的 /adaccounts 边缘从该用户的帐户获取广告帐户时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/

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

我正在使用来自 Node.js 服务器的 fetch 向 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
      })

解决方法

尝试获得 ads_management 权限。

根据 FB 文档,我猜与 /adaccounts 关联的权限是 ads_management。而 ads_read 与 Insight API 等阅读广告报告相关。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。