RequiredError.REQUIRED... What is missing?

152 views
Skip to first unread message

s...@feedonomics.com

unread,
Jun 28, 2017, 1:39:26 PM6/28/17
to AdWords API Forum
I believe this is coming from my addKeyword function:

<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError">
<fieldPath>operations[6].operand.criterion.text</fieldPath>
<fieldPathElements>
<field>operations</field>
<index>6</index>
</fieldPathElements>
<fieldPathElements>
<field>operand</field>
</fieldPathElements>
<fieldPathElements>
<field>criterion</field>
</fieldPathElements>
<fieldPathElements>
<field>text</field>
</fieldPathElements>
<trigger/>
<errorString>RequiredError.REQUIRED</errorString>
<ApiError.Type>RequiredError</ApiError.Type>
<reason>REQUIRED</reason>
</errors>

Do we know what's causing this? Here's the code within the function:

  $keyword = new Keyword();
  $keyword
->text = $keywordToAdd;
  $keyword
->matchType = $match_type;

  $adGroupCriterion
= new BiddableAdGroupCriterion();
  $adGroupCriterion
->adGroupId = $adGroupId;
  $adGroupCriterion
->criterion = $keyword;
  $adGroupCriterion
->userStatus = $status;

  $urlList
= new UrlList();
  $urlList
->urls = $finalUrls;
  $adGroupCriterion
->finalUrls = $urlList;

  $operation
= new AdGroupCriterionOperation();
  $operation
->operand = $adGroupCriterion;
  $operation
->operator = 'ADD';

 
return $operation;

Shwetha Vastrad (AdWords API Team)

unread,
Jun 28, 2017, 4:30:36 PM6/28/17
to AdWords API Forum
Hi, 

Could you check the list of uploaded operations to see if the keyword text is provided correctly? Are you using PHP client library perform these operations? If so, you need to set the keyword text as shown below:

$keyword->setText($text);

Thanks,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages