[英]Facebook Ads API try connection error - (Unsupported get request. Object with ID 'act_)
I am trying to do the first connection with the Facebook ADs And I used the Quickstart code example using PHP:我正在尝试与 Facebook 广告建立第一次连接,并且我使用了使用 PHP 的快速入门代码示例:
Then I create the following code:然后我创建以下代码:
public function start(){
$api = Api::init($this->_app_id, $this->_app_secret, $this->_access_token);
$api->setLogger(new CurlLogger());
$fields = array( 'campaign_name','campaign_id' );
$params = array(
'level' => 'campaign',
'filtering' => array(array('field' => 'delivery_info','operator' => 'IN','value' => array('active','scheduled','completed','recently_completed','archived','permanently_deleted')),array('field' => 'objective','operator' => 'IN','value' => array('CANVAS_APP_ENGAGEMENT','MOBILE_APP_ENGAGEMENT')),array('field' => 'updated_time','operator' => 'GREATER_THAN','value' => 1580014800000)),
'breakdowns' => array('monthly','action_device','ad_id'),
'time_range' => array('since' => '2019-12-01','until' => '2020-01-01'),
);
echo json_encode((new AdAccount($this->_ad_account_id))->getInsights(
$fields,
$params
)->getResponse()->getContent(), JSON_PRETTY_PRINT);
}
But I am always getting this error:但我总是收到此错误:
Unsupported get request.不支持的获取请求。 Object with ID 'act_xxxxxxxxxxxxx' does not exist, cannot be loaded due to missing permissions, or does not support this operation. ID 为“act_xxxxxxxxxxxxx”的对象不存在,由于缺少权限而无法加载,或不支持此操作。 Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api请阅读https://developers.facebook.com/docs/graph-api 上的 Graph API 文档
I could see this into the settings I have this information:我可以在我拥有以下信息的设置中看到这一点:
Just to help if someone has the same problem:只是为了帮助如果有人有同样的问题:
I solved it.我解决了。
The solution is simple, to get the correct Ad Account ID Visit the following link.解决方案很简单,获取正确的广告帐户 ID 访问以下链接。 with your valid access token.使用您的有效访问令牌。 https://graph.facebook.com/v5.0/me/adaccounts?access_token= https://graph.facebook.com/v5.0/me/adaccounts?access_token=
Hope it was helpful.希望它有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.