gpt4 book ai didi

facebook-graph-api - Facebook 广告 API : Error 272 This Ads API call requires the user to be admin

转载 作者:行者123 更新时间:2023-12-01 16:15:49 24 4
gpt4 key购买 nike

我正在使用 Facebook Ad Api 制作广告。当我通过以下 api 调用授予用户管理员角色 (1001) 时:

https://graph.facebook.com/v2.5/<AD_ACCOUNT_ID>/users?role=1001&uid=xxxxx

它成功创建了用户,当我使用以下请求获得所有用户时:

https://graph.facebook.com/v2.5/<AD_ACCOUNT_ID>/users

它成功返回数组:

"{"data":[{"name":"firstname lastname","permissions":[1,2,3,4,5,7],"role":1001,"id":"101xxxxxxxxxx352"}}"

但是当我尝试使用新添加的用户创建广告系列或广告集时,会抛出以下异常:

[FacebookAds\Http\Exception\AuthorizationException]
(#272) This Ads API call requires the user to be admin of the application. User 16xxxxx351 not admin or developer for application 109xxxxxxxx0403.

当我转到我的应用并为用户分配管理员或开发人员角色时,我可以成功发出请求。

为什么 facebook 不允许从 api 创建的具有管理员角色的用户不对其 Ad Api 进行 api 调用?为什么当用户被授予管理员/开发人员角色时允许提出请求?

最佳答案

这是因为您可以推广的对象不是基于 adaccount,而是基于您的用户。

您可以通过发出以下请求来查看用户有权访问的连接对象:

<API_VERSION>/act_<AD_ACCOUNT_ID>/connectionobjects?access_token=<ACCESS_TOKEN>

文档指出:

this call returns the IDs of all objects for which the current session user is an administrator, and the IDs of apps for which the user is listed as a developer or advertiser.

关于facebook-graph-api - Facebook 广告 API : Error 272 This Ads API call requires the user to be admin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33998301/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com