AdGroupAdService mutate return NULL

50 views
Skip to first unread message

de...@ubc-corp.com

unread,
Jan 11, 2018, 10:10:27 AM1/11/18
to AdWords API Forum
Hi,

Please, check out my code:

$operations = [];
$expandedTextAd
= new ExpandedTextAd();
$expandedTextAd
->setHeadlinePart1($HeadlinePart1);
$expandedTextAd
->setHeadlinePart2($HeadlinePart2);
$expandedTextAd
->setDescription($Description);
$expandedTextAd
->setFinalUrls([$FinalUrl]);
$adGroupAd
= new AdGroupAd();
$adGroupAd
->setAdGroupId($AdGroupId);
$adGroupAd
->setAd($expandedTextAd);
$adGroupAd
->setStatus(AdGroupAdStatus::PAUSED);
$operation
= new AdGroupAdOperation();
$operation
->setOperand($adGroupAd);
$operation
->setOperator(Operator::ADD);
$operations
[] = $operation;
$result
= $adGroupAdService->mutate($operations);



But $result is NULL

Why?

Thanks

  

Bharani Cherukuri (AdWords API Team)

unread,
Jan 11, 2018, 1:22:43 PM1/11/18
to AdWords API Forum
Hello, 

You code snippet looks fine. However, to investigate the issue further, could you enable logging and share us the complete SOAP request and response logs along with the clientCustomerId, so I can take a look? Please use Reply privately to author option to provide the details. You may also refer to this PHP code sample as a reference. 

Regards,
Bharani, AdWords API Team

de...@ubc-corp.com

unread,
Jan 12, 2018, 3:56:00 AM1/12/18
to AdWords API Forum
I found the cause of the problem.

It was - $session->setValidateOnly(true);

SOAP response was NULL ! Nothing! 

But when I change to $session->setValidateOnly(false);

I take correctly SOAP response - object(Google\AdsApi\AdWords\v201710\cm\AdGroupAdReturnValue)#1309 (4) { ...

Although a few months ago everything worked.

Thanks

четверг, 11 января 2018 г., 20:22:43 UTC+2 пользователь Bharani Cherukuri (AdWords API Team) написал:
Reply all
Reply to author
Forward
0 new messages