Tried to pause a campaign, while doing so, I get this error. This error occurs on and off.

20 views
Skip to first unread message

Gayatri T

unread,
Nov 8, 2019, 1:20:31 AM11/8/19
to AdWords API and Google Ads API Forum
Tried to pause a campaign, while doing so, I get this error. This error occurs on and off.

"'PHP Fatal error: Uncaught Google\AdsApi\AdWords\v201809\cm\ApiException: [RateExceededError <rateName=OperationsPerDay, rateKey=basic_access_operations, rateScope=DEVELOPER, retryAfterSeconds=86400>] in /var/www/DH2-MASTER/application/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:43'

Code : 
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));
        $totalNumEntries = 0;     
        do{
            $page = $campaignService->get($selector);
             if ($page->getEntries() !== null) {

                $totalNumEntries = $page->getTotalNumEntries();
                 foreach ($page->getEntries() as $campaign) {
                    $campaign->setStatus(CampaignStatus::PAUSED);
                    $operations = [];
                    $operation = new CampaignOperation();
                    $operation->setOperand($campaign);
                    $operation->setOperator(Operator::SET);
                    $operations[] = $operation;
                    $result = $campaignService->mutate($operations);

                    $campaign = $result->getValue()[0];
                    printf("Campaign with ID %d was removed.\n", $campaign->getId());
                 }
             }
        }while ($selector->getPaging()->getStartIndex() < $totalNumEntries);
    }

Google Ads API Forum Advisor Prod

unread,
Nov 8, 2019, 1:57:19 PM11/8/19
to gayathr...@gmail.com, adwor...@googlegroups.com
Hi Gayatri,

This error occurs when your API calls for the day exceeds its rate limits. You can find ways to avoid them and more details here. You can also apply for Standard API access, which will give you unlimited API calls.

Regards,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001UMWeuF:ref

Gayatri T

unread,
Nov 12, 2019, 3:13:38 AM11/12/19
to AdWords API and Google Ads API Forum
Hi, 

 Actually I tried to call the method only once. But still this error occurs everyday
Can you please check why this occurs even for one call with this request Id

requestId=00059721ac2ef79f0a6216d52d0e9fd9 

[2019-11-12 03:02:42] AW_SOAP.WARNING: clientCustomerId=8658281137 operations=1 service=CampaignService method=mutate responseTime=136 requestId=00059721ac2ef79f0a6216d52d0e9fd9 server=adwords.google.com isFault=1 faultMessage=[RateExceededError <rateName=OperationsPerDay, rateKey=basic_access_operations, rateScope=DEVELOPER, retryAfterSeconds=86400>]  
[2019-11-12 03:02:42] AW_SOAP.NOTICE: POST /api/adwords/cm/v201809/CampaignService?wsdl HTTP/1.1
Connection: close
User-Agent: PHP-SOAP/7.3.3-1+ubuntu16.04.1+deb.sury.org+1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 866
Authorization: REDACTED

Reply all
Reply to author
Forward
0 new messages