douwei1944 2017-04-21 05:58
浏览 417

如何获得广告活动在Facebook广告Api PHP SDK上花费跟踪?

How can I get the campaigns on my Ad Account id using Facebook PHP SDK v2.8

public function sync_expenses_get()
{
    //initialize credentials
    $appId = $this->config->item('app_id');
    $appSecret = $this->config->item('app_secret');
    $accessToken = $this->config->item('access_token');
    Api::init($appId, $appSecret, $accessToken);

    $account = new AdAccount('act_<AD_ACCOUNT_ID>');
    $cursor = $account->getCampaigns();

}

And I am just getting an error like this

( ! ) Fatal error: Uncaught exception 'FacebookAds\Http\Exception\AuthorizationException' with message '(#2) Service temporarily unavailable' in /htdocs/vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php on line 140

I just want to get first all the campaigns under my ad account ID.

  • 写回答

1条回答 默认 最新

  • duanqiao9541 2017-05-17 11:47
    关注

    The error you are getting is not based on your code, but is a generic error that is returned when a web service isn't able to respond to your request for some unexpected reason.

    You should re-try your request in this case and in most cases this resolves the problem.

    In the case that this is persistent, you should file a bug: https://developers.facebook.com/bugs

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog