作为Meta应用管理员,无法获取Marketing API OAuth权限如何测试?
我正在将Meta(Facebook)Marketing API集成到Next.js应用中。仅请求email scope时,OAuth功能正常,但添加ads_read、ads_management或pages_manage_ads等营销类权限后,返回的access token不包含这些权限。我是该应用的管理员和创建者,原本期望能在本地测试这些权限。
登录URL生成代码
const authUrl = `https://www.facebook.com/v21.0/dialog/oauth?client_id=${META_CLIENT_ID}&redirect_uri=${encodeURIComponent( META_REDIRECT_URI )}&state=${encodeURIComponent(state)}&scope=email,ads_read,pages_manage_ads,ads_management`; res.redirect(authUrl);
问题现象
仅请求email时,我能获取有效的短期token,可兑换为长期token,一切正常。但添加营销类scope后,登录重定向正常完成,但响应仅返回email权限,调用Marketing API时会因权限不足报错。
报错信息
This content isn't available at the moment
Invalid Scopes: ads_read, pages_manage_ads, ads_management, pages_show_list. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions
已完成的操作
- 反复校验redirect URI完全匹配
- 确认应用处于开发模式
- 使用应用所属的Facebook账号登录
当前配置
- 商业资料正在审核中,尚未通过
- 本地测试使用的redirect URI为
http://localhost:3000/api/integrations/meta/callback state参数和token兑换流程无问题,仅请求的营销类scope未包含在返回的token中
疑问
为何作为应用管理员登录时,仅能获取含email scope的token,无法获取营销类scope?如何在商业审核完成前测试这些权限?
内容的提问来源于stack exchange,提问作者Sam Chahine




