【发布时间】:2016-11-16 12:29:15
【问题描述】:
我有企业帐户和 2 个广告帐户。当我尝试创建第三个广告帐户时,出现以下错误。
You have exceeded the number of allowed ad accounts for your Business Manager at this time.
和
(#10) You do not have permission to perform this action. This action requires that you can MODIFY_AD_ACCOUNTS for this business account.
根据 Facebook https://developers.facebook.com/docs/marketing-api/reference/ad-account,我们必须使用用户权限才能避免此错误。
但在业务管理器中创建广告帐户时,用户权限不起作用。它在更新广告帐户时工作正常。下面的代码,我正在使用。
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/v2.8/'.$associative_arr['businessId'].'/adaccount/userpermissions');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close ($ch);
任何建议我如何在创建广告帐户时使用用户权限,以便我可以抑制广告帐户限制问题?
【问题讨论】:
标签: facebook-graph-api facebook-php-sdk facebook-marketing-api