Facebook 业务 PHP SDK:无法访问不由拥有此应用的企业管理的对象
Facebook Business PHP SDK : Cannot access an object not managed by the business owning this app
我正在尝试使用 Facebook Business SDK. But when I use method createAdAccount
it gives me an error. please see the image attached below. Here is the documentation about adacount creation
创建一个 Facebook Adaccount
我正在这样使用createAdAccount
。
public function createAdAccount() {
//$params['name'] = "My test Partner";
$params = ['name' => 'My test Partner',
'currency' => 'USD',
'timezone_id' => 1,
'end_advertiser'=> 'NONE',
'media_agency' => 'UNFOUND',
'partner' => 'UNFOUND'
];
$buisness = new Business('<buisness account id>');
$adacount = $buisness->createAdAccount(['name'], $params);
echo "<pre>"; print_r($adacount);
}
更新:
我还在我的企业帐户中添加了我的应用程序 ID。
任何帮助,将不胜感激。提前致谢。
我明白了这背后的原因。这是由于错误,因为我没有将应用程序添加到我的商务经理帐户中。我添加了该应用程序并且它有效。
如果您遇到同样的问题,请参考屏幕截图。
您需要进入您的业务经理设置并添加该应用程序。
希望对需要的人有所帮助。
我正在尝试使用 Facebook Business SDK. But when I use method createAdAccount
it gives me an error. please see the image attached below. Here is the documentation about adacount creation
我正在这样使用createAdAccount
。
public function createAdAccount() {
//$params['name'] = "My test Partner";
$params = ['name' => 'My test Partner',
'currency' => 'USD',
'timezone_id' => 1,
'end_advertiser'=> 'NONE',
'media_agency' => 'UNFOUND',
'partner' => 'UNFOUND'
];
$buisness = new Business('<buisness account id>');
$adacount = $buisness->createAdAccount(['name'], $params);
echo "<pre>"; print_r($adacount);
}
更新:
我还在我的企业帐户中添加了我的应用程序 ID。
我明白了这背后的原因。这是由于错误,因为我没有将应用程序添加到我的商务经理帐户中。我添加了该应用程序并且它有效。
如果您遇到同样的问题,请参考屏幕截图。
您需要进入您的业务经理设置并添加该应用程序。
希望对需要的人有所帮助。