Ads API .NET library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Google.Api.Ads.AdWords.Examples.CSharp.OAuth.ConsoleExample Class Reference

This code example shows how to run an AdWords API command line application while incorporating the OAuth2 installed application flow into your application. If your application uses a single AdWords manager account login to make calls to all your accounts, you shouldn't use this code example. Instead, you should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh token and set that in user.Config.OAuth2RefreshToken field, or set OAuth2RefreshToken key in your App.config / Web.config. More...

Detailed Description

This code example shows how to run an AdWords API command line application while incorporating the OAuth2 installed application flow into your application. If your application uses a single AdWords manager account login to make calls to all your accounts, you shouldn't use this code example. Instead, you should run Common\Util\OAuth2TokenGenerator.cs to generate a refresh token and set that in user.Config.OAuth2RefreshToken field, or set OAuth2RefreshToken key in your App.config / Web.config.

This code example depends on Console environment only for reading and writing values, you may use this code example in other environments like Windows Form applications with minimial modifications.

To run this application,

  1. You should create a new Console Application project.
  2. Add reference to the following assemblies:
    Google.Ads.OAuth.dll Google.AdWords.dll System.Web System.Configuration
  1. Replace the Main() method with this class's method.
  2. Copy App.config from AdWords.Examples.CSharp project, and configure it as shown in ths project's App.config.
  3. Compile and run this example.

The documentation for this class was generated from the following file: