A little over a week ago we published a blog post informing developers that we would begin requiring a developer token with report downloads to better allow us to monitor reports, and extended the deadline in an update. We are changing the deadline to Tuesday January 17th, 2012 to give our developers more time during the busy holiday season.
As mentioned in our prior update, the sandbox will still have this change as of November 16th. We strongly encourage you to use the time between November 16th and January 17th to make the change to your applications, test against the sandbox and move the change to production. The existing production report download will ignore the header until it is required, which means you can implement the changes before the deadline without it breaking your existing applications.
We will update the client libraries to help you implement this change before the November 16th change in the sandbox environment. Please see our report download documentation for more information regarding report downloads. If you have any questions or would like to discuss this change, please post on the forum or try to attend our Google+ Hangouts with members of the AdWords API Developer Relations Team.
UPDATE2: Developer Token Required In Report Downloads
월요일, 11월 14, 2011
UPDATE: Developer Token Required In Report Downloads
화요일, 11월 08, 2011
We’d also like to clarify two additional points:
- We will start requiring the developer token as an HTTP header for report downloads in the sandbox as of November 16th. This will allow developers to make requests with the developer token as an HTTP header to ensure their application will continue to function as expected when the production server begins requiring the developer token.
- While the production service will begin requiring the developer token on November 29th, you can provide this HTTP header today and the server will still accept the request. This means you can add the developer token in advance of the deadline without fear that report download functionality will be interrupted.
ACTION REQUIRED: Developer Token Required In Report Downloads Starting 11/23
목요일, 11월 03, 2011
All report downloads - whether they be AdHoc or pre-v201109, using either GET or POST - must provide the developer token as an HTTP header. Example formatting of header:
developerToken: 1a2B3c4D5e_-6v7w8x9y0z
If your application fails to provide the developer token as an HTTP header after November 23rd, it will receive the error message QuotaCheckError.INVALID_TOKEN_HEADER when downloading reports.
We will be publishing updates to the example and utility code in the client libraries to reflect this change. Please see our report download documentation for more information regarding report downloads. If you have any questions or would like to discuss this change, please post on the forum or try to attend our Google+ Hangouts with members of the AdWords API Developer Relations Team.
Client Library Updates
수요일, 11월 02, 2011
Java
- Support for v201109 was added along with utility code for AdHoc reports in v8.4.0.
- Released reference implementation to download reports for lots of client accounts.
- Support for v201109 was added along with utility code for AdHoc reports in v13.0.0.
- Project hosting has moved here.
- Support for v201109 was added along with utility code for AdHoc reports in v15.0.3.
- Updated common module from version 2.1.0 to version 3.0.0, which may impact your code. See the ChangeLog for more details.
- Support for v201109 was added along with utility code for AdHoc reports in v0.4.1.
- Now properly handles xsi:type in XML responses.
- Support for v201109 was added along with utility code for AdHoc reports in v2.5.0.
- Support for v201109 was added along with utility code for AdHoc reports in v2.7.0.
- Bug fixes and minor improvements.
- Support for v201109 was added along with an example for AdHoc reports in v1.1.0.
If you have any questions or would like to discuss these changes, please post on the forum.
AdWords API now fully supports OAuth 1.0a
화요일, 10월 11, 2011
OAuth is an open standard for authorization. Google uses this standard to allow applications to access a user’s data (in this case AdWords) without requiring the user to give the application their Google username and password.
In OAuth, an application starts by contacting Google with an OAuth request. Next, the application redirects the user to Google to authorize the request. Once authorized, the user is directed back to the application, which can then upgrade their request token to an access token which the application can use to make requests to Google in lieu of a username and password.
The client libraries have code to handle much of the OAuth process for you. We have provided code examples in many languages to demonstrate how to use OAuth with the client libraries: DotNet, Python, Ruby, Perl, PHP.
Please note that making your first request against the sandbox using OAuth will not create accounts for you as described here. Please make your first request to the sandbox using email/password authentication to provision the sandbox accounts and make subsequent requests with OAuth.
For more information about using OAuth with Google APIs, please see this documentation.
If you have any questions about using OAuth with the client libraries, you can ask us on the forum.
Edit: the link describing how accounts are provisioned for you in the AdWords API sandbox was omitted in the original blog post. This link has been updated and is located here.
Client Library Updates
월요일, 9월 19, 2011
Ruby
- Made performance improvements.
- Added unit spend information to responses.
- Added support for Proxy servers.
Python
- Updated common module to version 2.1.0, which may impact your code. See the ChangeLog for more details.
- Fixed issues 161, 162, 163 in version 14.2.3.
- Added a tarball in the download section that collects all the required modules for this client library into a single download with an installer script.
You can download updated versions of the AdWords API client libraries from their respective sites, or see a list of all the client libraries.
If you have any questions or would like to discuss these changes, please post on the forum.
Client Library Updates
화요일, 8월 16, 2011
DotNet
- Client library now supports OAuth 1.0a as an authentication mechanism.
- Added support for caching authTokens.
- Will now automatically retry for GOOGLE_ACCOUNT_COOKIE_INVALID error.
- Additionally, a number of issues were fixed: 51, 62, and 65.
- Support has been added to generate classes from the WSDL using pseudo-namespaces, to avoid conflicts with other classes. The library must be built from source with this option. Please see the README for more information. This addresses issue 4.
- Improved type conversion to better handle ID values on 32-bit systems. This addresses issue 62.
- First release based on Savon backend (0.4.0).
- Includes OAuth 1.0a support and Ruby 1.9 compatibility.
If you have any questions or would like to discuss these changes, please post on the forum.
Client Library Updates
수요일, 7월 20, 2011
Python
- Added support for OAuth as an authentication mechanism. This will allow developers to access the API without requiring a username and password. See the new code example for more information on how to integrate OAuth with your application.
- Additionally, a number of issues were fixed: 115, 142, 144, and 145.
Perl
- Fixed some bugs that prevented usage of multiple Client objects.
- Full XPath support was added; XPath queries can now be done through the entire tree of results.
- OAuth support was also added.
Ruby
- Improved support for UTF reports in download extensions.
- New logger interface.
- Updates have been made to the code examples.
PHP
- Updated OAuth support to allow for alternative OAuth libraries, including the bundled Andy Smith library.
- The logging functionality has been updated to support filtering for levels. The default logging behavior has been changed to only log SOAP XML if an error occurs.
- New methods were added to AdWordsUser for additional logging configuration. The AdWords Get*Service() methods were replaced with a single GetService() method. Backwards compatibility was maintained using __call(). All examples and tests were updated to use the new method.
- Additionally, 2 issues were fixed: 55 and 59.
You can download updated versions of the AdWords API client libraries from their respective sites, or see a list of all the client libraries using this link.
If you have any questions or would like to discuss these changes, please post on the forum.
Kevin Winter, AdWords API Team
AdWords API JavaScript library - Getting started
금요일, 6월 17, 2011
Recently, we launched the AdWords API JavaScript Client library. This blog post discusses its basic usage by explaining the GetAllCampaigns example.
Including required scripts
AdWords API JS library comes with the following compiled scripts that you can include in your web page:
- awapi.js: This is the AdWords API JS library, combined into a single script.
- v201101.js: This is the compiled script for AdWords API v201101. There are compiled scripts for each supported API version.
- config.js: This is optional; if included, you can define your application configuration in this file.
To use any type provided by the AdWords API JS library, you need to import it. For instance, to import the CampaignService object, use
<script type="text/javascript">
goog.require('google.ads.adwords.v201101.CampaignService');
</script>
All the goog.require statements should be put together in a single <script>
tag.Creating a User and obtaining a service instance
In the AdWords API JS library, each AdWords account is represented using a User object. The User object allows you to create various services provided by the AdWords API and make calls against the AdWords account associated with this user. The code to do this is given below:
var user = new google.ads.adwords.User();
var campaignService = user.getService(google.ads.adwords.AdWordsService.v201101.
CampaignService);
The user takes a config object as its constructor argument. If you don't provide one, then the config definition from config.js is used.Calling the method and displaying results
The code to construct a selector and get all the campaigns is shown below:
// Create a selector.
var selector = new google.ads.adwords.v201101.Selector();
selector.fields = ["Id", "Name", "Status"];
campaignService.get(selector,
goog.bind(function(page) {
if (page && page.entries && page.entries.length > 0) {
for (var i = 0, len = page.entries.length; i < len; i++) {
var campaignValue = page.entries[i];
alert(goog.string.format('Campaign with id = "%s", name = "%s" ' +
'and status = "%s" was found.', campaignValue.id,
campaignValue.name, campaignValue.status));
}
} else {
alert('No campaigns were found.');
}
callback();
}, this),
goog.bind(function(soapException) {
alert(goog.string.format('Failed to get campaign(s). Soap Fault ' +
'says "%s"', soapException.getInnerException().getFaultString()));
callback();
}, this)
);
The important thing to note here is that unlike other languages, JavaScript client library implements all API calls as asynchronous methods. Each method accepts an onSuccess callback and an onFailure callback which will be called when a call succeeds or fails respectively. The prototype of onSuccess and onFailure callbacks are as shown below:function onSuccess(results) {
}
function onFailure(soapException) {
// soapException is an object of type ApiException
}
Setting up an HttpWebTransportTo make the AdWords API calls, the client library needs to POST xml data to the AdWords API Server. The exact mechanism for making these calls depend on the environment your code is running. You can set an appropriate HttpWebTransport in your config.js to tell the client library how to make its calls to the AdWords API server. The relevant snippet is given below:
HttpWebTransport: 'google.system.net.HttpWebTransportForServerProxy',
HttpWebTransportSettings: {
ProxyUrl: '/awapi-js-lib/proxy.php'
}
When writing code for a normal website, you need to use HttpWebTransportForServerProxy as transport mechanism. This HttpWebTransport forwards your calls through a server-side proxy script. This is required since all modern browsers implement same origin policy that prevents the library from making a cross-domain XmlHttpRequest. When writing code for a Chrome extension, you can make cross-domain xhr calls, if the domain is specified in the manifest file. In such cases, you can use HttpWebTransportForExtensions instead. You can refer to the README file for details on various HttpWebTransports provided by the library.
Please join us on the AdWords API forum to discuss the new client library and the Chrome extension and report any bugs on the project’s issue tracker or forum.
New client library launch: AdWords API JavaScript library
금요일, 6월 10, 2011
Getting the AdWords API JS library
The AdWords API JS library is listed on the AdWords API client libraries page, and is hosted at http://code.google.com/p/google-api-adwords-js.
The library distribution is available for download from the downloads page: http://code.google.com/p/google-api-adwords-js/downloads/list.
You can find installation and running instructions as well as usage examples on the project wiki page: http://code.google.com/p/google-api-adwords-js/wiki/Readme
Features
The following are the main features of the AdWords API JS library:
- Full support for AdWords API versions v201008 and v201101.
- Code examples for all the common AdWords tasks, similar to other client libraries.
- Tested to work in Internet Explorer, Firefox, and Chrome. See the project wiki for details.
- Includes minified JS scripts, compiled and optimized using the Closure compiler.
- JSDoc documentation for the entire library.
Sample AdWords API JS Chrome extension
We believe that Chrome and Firefox browser extension developers will benefit most from this client library. Keeping this in mind, we developed a Chrome extension that allows an AdWords user to browse his Campaigns, Ad Groups, Ads and Keyword statistics. The extension is being made available as a code example at this address. You can refer to the wiki article at http://code.google.com/p/google-api-adwords-js/wiki/ObjectStatsExtensionReadme for details on its installation and use.
Please join us on the AdWords API forum to discuss the new client library and the Chrome extension and report any bugs on the project’s issue tracker or forum.
-


Discover v2009: New Examples in Client Libraries
금요일, 12월 11, 2009
Our Discover v2009 series has focused on introducing you to the new services and objects that come with the update to the API. And while we hope these posts have been informative we know there is nothing like running a code example yourself to bring the concepts to life. That's why we've spent the last few weeks completely re-hauling the examples in our client libraries to provide a more complete set of sample code to try out. The following client libraries now have over 30 examples for the v200909 version of the API:
As always, we are here to answer your questions, collect feedback, and assist with migration to the v2009 API.
- Eric Koleda, AdWords API Team