First API call_Get AdWords Quality

101 views
Skip to first unread message

API_DCH

unread,
May 15, 2018, 5:31:32 PM5/15/18
to AdWords API and Google Ads API Forum
This is my first attempt at this. How can I run the select statement below on report  KEYWORDS_PERFORMANCE_REPORT using API call?
I use Zappy Sys API client. I like to, some how ,insert this select statement into the API code below.  Any suggestions how to do that?
Thanks,
 

SELECT Criteria,CampaignName,AdGroupName,KeywordMatchType,Clicks,Impressions,Ctr,AverageCpc,CpcBid,Cost,AveragePosition,Conversions,CostPerConversion,ConversionRate,SearchImpressionShare,QualityScore

 FROM KEYWORDS_PERFORMANCE_REPORT WHERE 

                        IsNegative = FALSE

                        AND Status = ENABLED

                        AND AdGroupStatus = ENABLED

                        AND CampaignStatus = ENABLED

                  DURING 20180101,20180331



<?xml version="1.0" encoding="utf-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://adwords.google.com/api/adwords/mcm/v201802" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:cm="https://adwords.google.com/api/adwords/cm/v201802">

  <soapenv:Header>

    <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/mcm/v201802" xmlns="https://adwords.google.com/api/adwords/mcm/v201802">

<developerToken>[I have this token]l</developerToken>

<clientCustomerId>[I have this ID]</clientCustomerId>

<userAgent>[I have this agent]</userAgent>

</RequestHeader>

    </ns1:RequestHeader>

  </soapenv:Header>

  <soapenv:Body>


??????????


  </soapenv:Body>

</soapenv:Envelope>

Luis Xander Talag (AdWords API Team)

unread,
May 15, 2018, 11:47:48 PM5/15/18
to AdWords API and Google Ads API Forum
Hi,

My apologies as we do not support third party API. However, you may visit this guide to know more on how to create a report definition in the AdWords API. You could also use the AWQL in generating a report. See this link for an example showing the report definition within an HTTP Post request.

Thanks and regards,
Luis
AdWords API Team

API_DCH

unread,
May 17, 2018, 11:11:14 PM5/17/18
to AdWords API and Google Ads API Forum
Hi Luis,

I tried the api call and I receive following error message, it says ".DEVELOPER_TOKEN_NOT_APPROVED". What is the process to get the token approved, how much time will it take to get approved. 
I have also include the call details

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/v201802"><requestId>00056c7235bcb3800aa780454d0cee71</requestId><serviceName>AdGroupService</serviceName><methodName>query</methodName><operations>1</operations><responseTime>125</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED @ ; trigger:'&lt;null&gt;']</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201802"><message>[QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED @ ; trigger:'&lt;null&gt;']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="QuotaCheckError"><fieldPath></fieldPath><trigger>&lt;null&gt;</trigger><errorString>QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED</errorString><ApiError.Type>QuotaCheckError</ApiError.Type><reason>DEVELOPER_TOKEN_NOT_APPROVED</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>

<?xml version="1.0" encoding="utf-8"?>
<soap:Header>
<developerToken>{{User::varDevToken}}</developerToken>
<clientCustomerId>{{User::varClientId}}</clientCustomerId>
<userAgent>ZappySys SSIS PowerPack v1</userAgent>
</RequestHeader>
</soap:Header>
<soap:Body>
<query>
SELECT Id, Name
WHERE Status = 'ENABLED'
ORDER BY Name
DESC LIMIT 0,50
</query>
</query>
</soap:Body>
</soap:Envelope>

Thanks
Sam

Luis Xander Talag (AdWords API Team)

unread,
May 18, 2018, 2:05:12 AM5/18/18
to AdWords API and Google Ads API Forum
Hi Sam,

The QuotaCheckError.DEVELOPER_TOKEN_NOT_APPROVED error means that you are using an unapproved developer token to make calls against a production account. An unapproved developer token can only make calls against test AdWords accounts. To be able to make calls against the production account, the developer token will need to have either basic or standard access. You can apply for basic access by submitting this form. The API compliance team usually responds within two business days for the status. Once the token is approved, you can try the request again and it should work fine.

Regards,
Luis
AdWords API Team

API_DCH

unread,
May 18, 2018, 3:31:05 PM5/18/18
to AdWords API and Google Ads API Forum
Hi Luis,

Thanks for the information, I have submitted the form to upgrade my token to get basic access. So that I can move forward to make some api calls to production account..
I learned that approval may take up to 2 business days. Do I get a confirmation email once it is approved. Please let me know.
Once approved, can I make api calls to all the account that are linked to the Adwords account.

Thanks
Sam

Peter Oliquino (AdWords API Team)

unread,
May 21, 2018, 2:02:39 AM5/21/18
to AdWords API and Google Ads API Forum
Hi Sam,

Allow me to provide support for now as Luis is currently OOO. The AdWords Compliance team should send you an email within 2 business days. If by chance they don't, just let me know so I can notify their team to assist you. Also, once approved, you should be able to make calls using the AdWords API against production accounts, this is considering that you have also already created your OAuth2 credentials.

Best regards,
Peter
AdWords API Team

API_DCH

unread,
May 22, 2018, 10:34:48 AM5/22/18
to AdWords API and Google Ads API Forum
Hi Peter,

My test token has been upgrade to basis level.

Thanks for your help.

Regards
Sam

API_DCH

unread,
May 22, 2018, 11:29:50 AM5/22/18
to AdWords API and Google Ads API Forum
Hi Peter,

Do you have any sample code that I can use to understand how to retrieve data from "KEYWORD_PERFORMANCE_REPORT". 
I am using following code, which looks like the standard code that has been discussed in this forum and documentation. But I am having trouble in retrieving google AdWords data.
Can you please provide me the url to which this xml request should be submit. Please see the following code and xml body and let me know if you find something not right. I have data on google AdWords account for the period what I am querying.


<?xml version="1.0" encoding="utf-8"?>
<soap:Header>
<developerToken>{{User::varDevToken}}</developerToken>
<clientCustomerId>{{User::varClientId}}</clientCustomerId>
<userAgent>ZappySys SSIS PowerPack v1</userAgent>
</RequestHeader>
</soap:Header>
<soap:Body>
<reportDefinition
<selector>
<fields>CampaignId</fields>
<fields>AdGroupId</fields>
<fields>CampaignName</fields>
<fields>AdGroupName</fields>
<fields>Criteria</fields>
<fields>Status</fields>
<fields>SystemServingStatus</fields>
<fields>Impressions</fields>
<fields>Clicks</fields>
<fields>Cost</fields>
<fields>AverageCpc</fields>
<fields>Ctr</fields>
<fields>TrackingUrlTemplate</fields>
<fields>FinalMobileUrls</fields>
<fields>FinalUrls</fields>
<fields>AveragePosition</fields>
<fields>SearchImpressionShare</fields>
<fields>QualityScore</fields>
<fields>AccountCurrencyCode</fields>
<fields>AccountDescriptiveName</fields>
<predicates>
<field>Clicks</field>
<operator>GREATER_THAN</operator>
<values>0</values>
</predicates>
<dateRange>
<min>20180101</min>
<max>20180401</max>
</dateRange>
</selector>
<reportName>Report</reportName>
<reportType>KEYWORDS_PERFORMANCE_REPORT</reportType>
<dateRangeType>CUSTOM_DATE</dateRangeType>
<downloadFormat>CSV</downloadFormat>
</reportDefinition>
</soap:Body>
</soap:Envelope> 


Thanks
Sam

API_DCH

unread,
May 22, 2018, 12:11:50 PM5/22/18
to AdWords API and Google Ads API Forum
Hi ,

I am new to Google Adword platform, I need help on google AdWords KEYWORD_EPRFORMANCE_REPORT.
I am trying to retrieve google AdWords data using following xml body. what url I need to use to submit the xml request. 
currently I tried using this https://adwords.google.com/api/adwords/cm/v201802/AdGroupAdService and few others, but did not work. It doesn't return any data. I am looking for the correct url that should be used to retrieve data from KEYWORD_EPRFORMANCE_REPORT.

<?xml version="1.0" encoding="utf-8"?>
<soap:Header>
<developerToken>{{User::varDevToken}}</developerToken>
<clientCustomerId>{{User::varClientId}}</clientCustomerId>
<userAgent>ZappySys SSIS PowerPack v1</userAgent>
</RequestHeader>
</soap:Header>
<soap:Body>
<query>
SELECT Criteria,CampaignName,AdGroupName,KeywordMatchType,Clicks,Impressions,Ctr,AverageCpc,CpcBid,Cost,AveragePosition,Conversions,CostPerConversion,ConversionRate,SearchImpressionShare,QualityScore
  KEYWORDS_PERFORMANCE_REPORT WHERE 
                        IsNegative = FALSE
                        AND Status = ENABLED
                        AND AdGroupStatus = ENABLED
                        AND CampaignStatus = ENABLED
                  DURING 20180101,20180331
</query>
</query>
</soap:Body>
</soap:Envelope>


Thanks
Sam

Peter Oliquino (AdWords API Team)

unread,
May 23, 2018, 2:48:43 AM5/23/18
to AdWords API and Google Ads API Forum
Hi Sam,

If you wish to utilize the AdWords API reports then, you may first refer to our reporting guide for information on how to generate reports. Next is, you can refer to our sample report codes (also available in other languages) on how your code should look like when requesting them.

For your keywords, you may generate the Keywords Performance Report, as this report type specializes in fetching metrics and statistics of your keyword objects within your account. Also, if what you are looking for is an example on how to send a request via HTTP, then you may refer here for the API call structure. You can then include your report definition in that request and you can refer to this section of our reporting guide on how to construct the report. 

Let me know if this helps and feel free to create a new forum thread with this new concern.

Thanks and regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages