我正在尝试通过Facebook ads SDK获取所有ads帐户。我发现了以下错误
这是我的密码。
public function getAdAccounts() {
$user = new AdAccountUser('**************');
$user->read(array(AdAccountUserFields::ID));
$accounts = $user->getAdAccounts();
// Print out the accounts
echo "Accounts:\n";
foreach($accounts as $account) {
echo $account->id . ' - ' .$account->name."\n";
}
// Grab the first account for next steps (you should probably choose one)
$account = (count($accounts)) ? $accounts->getObjects()[0] : null;
echo "\nUsing this account: ";
echo $account->id."\n";
}
我试过了
explorer
它是有效的。