Closed vstruhar closed 5 years ago
Hm...on my project I have the same issue. +1 for the question
Did you try same curl call to check if the api call get the same response ?
Didn't try to make a clean curl request.
Here is a simplified code example of how facebook-php-business-sdk
was used.
Api::init($this->account->api_key, $this->account->api_password, $this->account->access_token);
$adAccount = new AdAccount('act_' . $this->account->account_id);
$fields = [AdsInsightsFields::SPEND, ... ];
$params = [
'time_range' => [
'since' => $startDate,
'until' => $endDate,
],
'time_increment' => 1,
'breakdowns' => [AdsInsightsBreakdownsValues::COUNTRY],
'limit' => 200,
];
try {
$insightsRequest = $adAccount->getInsights($fields, $params);
} catch (AuthorizationException $e) {
if ($e->getCode() == 17) {
Log::warning("Account request limit reached", [
'x-fb-ads-insights-throttle' => json_decode($insightsRequest->getLastResponse()->getHeaders()['x-fb-ads-insights-throttle'], 1)
]);
}
}
Hi, please add
$api = Api::instance();
$api->setLogger(new CurlLogger());
on top of your request, and then there will be a curl be printout for you. Then you can use the curl request to make api call directly. This is actually an api issue. Please report the issue on Devsite Bug Report channel: https://developers.facebook.com/support/bugs/ Thanks!
Hello,
I have noticed an issue when making requests, that the response header has:
{"app_id_util_pct":0,"acc_id_util_pct":0}
And the
app_id_util_pct
parameter goes only up to 0.01 and then unexpectedly I get aAuthorizationException
with a code 17, which is "User request limit reached"I was expecting that limit will be reached when
app_id_util_pct
oracc_id_util_pct
parameter end up at 100.Insights Call Load Limits: https://developers.facebook.com/docs/marketing-api/insights/best-practices/
Am I missing something?