Okay,  I think each field need to be in a separate line of code all 
together.

  <v201:fields>Id</v201:fields>
  <v201:fields>Name</v201:fields>

On Wednesday, February 10, 2021 at 1:09:32 PM UTC+5:30 Jagadish B wrote:

> I'm trying to send XML based Adwords API request to CampaignService.
>
> As per the API documentation for the CampaignService  
> <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.Selector>
>  we 
> can pass on multiple selector fields in the XML request. But I don't 
> understand the format in which these fields should be passed on ..
>
> I have tried the following formats for requesting Campaign Id and Campaign 
> Name selector fields, but it is giving me INVALID_FIELD_NAME error.
>
> Formats tried :  'Id','Name'  ;  [Id,Name]  ; ['Id','Name']  ----  All 
> raising same error.
> both Id and Name are valid fields for the CampaignService.
>
> Can any help me with what should be the format in which these selector 
> formats should be passed on?
>
> I attach the XML request body and Error below
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
> xmlns:v20="https://adwords.google.com/api/adwords/cm/v201809"; xmlns:v201="
> https://adwords.google.com/api/adwords/cm/v201809";>
>    <soapenv:Header>
>       <v20:RequestHeader>
>          <!--Optional:-->
>          <v201:clientCustomerId>767-***-9100</v201:clientCustomerId>
>          <!--Optional:-->
>          <v201:developerToken>c********nitijDtDzSklQ</v201:developerToken>
>          <!--Optional:-->
>          <v201:userAgent>SoapUI</v201:userAgent>
>          <!--Optional:-->
>          <v201:validateOnly>true</v201:validateOnly>
>          <!--Optional:-->
>          <v201:partialFailure>false</v201:partialFailure>
>       </v20:RequestHeader>
>    </soapenv:Header>
>    <soapenv:Body>
>       <v20:get>
>          <!--Optional:-->
>          <v20:serviceSelector>
>             <!--Zero or more repetitions:-->
>             <v201:fields>[Id,Name]</v201:fields>
>             <!--Zero or more repetitions:-->
>             <v201:predicates>
>                <!--Optional:-->
>                <v201:field>StartDate</v201:field>
>                <!--Optional:-->
>                <v201:operator>GREATER_THAN_EQUALS</v201:operator>
>                <!--Zero or more repetitions:-->
>                <v201:values>20200101</v201:values>
>             </v201:predicates>
>             <!--Optional:-->
>             <v201:dateRange>
>                <!--Optional:-->
>                <v201:min>20200101</v201:min>
>                <!--Optional:-->
>                <v201:max>20210131</v201:max>
>             </v201:dateRange>
>             <!--Zero or more repetitions:-->
>             <v201:ordering>
>                <!--Optional:-->
>                <v201:field>StartDate</v201:field>
>                <!--Optional:-->
>                <v201:sortOrder>ASCENDING</v201:sortOrder>
>             </v201:ordering>
>             <!--Optional:-->
>             <v201:paging>
>                <!--Optional:-->
>                <v201:startIndex>0</v201:startIndex>
>                <!--Optional:-->
>                <v201:numberResults>3</v201:numberResults>
>             </v201:paging>
>          </v20:serviceSelector>
>       </v20:get>
>    </soapenv:Body>
> </soapenv:Envelope>
>
> Error Msg:
> The remote server returned an error: (500) Internal Server Error.
> Response Url: 
> https://adwords.google.com/api/adwords/cm/v201809/CampaignService
>
> Status Code: InternalServerError
>
> Response Body: <soap:Envelope xmlns:soap="
> http://schemas.xmlsoap.org/soap/envelope/";><soap:Header><ResponseHeader 
> xmlns="https://adwords.google.com/api/adwords/cm/v201809
> "><requestId>0005baf675ca44de0a62e20866020df5</requestId><serviceName>CampaignService</serviceName><methodName>get</methodName><operations>0</operations><responseTime>149</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[SelectorError.INVALID_FIELD_NAME
>  
> @ serviceSelector; 
> trigger:'[Id,Name]']</faultstring><detail><ApiExceptionFault 
> xmlns="https://adwords.google.com/api/adwords/cm/v201809";><message>[SelectorError.INVALID_FIELD_NAME
>  
> @ serviceSelector; 
> trigger:'[Id,Name]']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors
>  
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:type="SelectorError"><fieldPath>serviceSelector</fieldPath><fieldPathElements><field>serviceSelector</field></fieldPathElements><trigger>[Id,Name]</trigger><errorString>SelectorError.INVALID_FIELD_NAME</errorString><ApiError.Type>SelectorError</ApiError.Type><reason>INVALID_FIELD_NAME</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
>
> Much appreciate your help on this.
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/719ac528-c382-4ce8-aed4-8b2d956bdc67n%40googlegroups.com.

Reply via email to