0

I am new to Google API.

I need to access Adword Offline Conversion API through .NET code.

In theory this is pretty easy since all the .NET code that implements this knowledge is provided here: https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/v201406/AdvancedOperations/UploadOfflineConversions.cs

In practice we need to get logged to google API (through the protocol OAuth 2.0 I guess?) and I didn't found any good documentation about this. There are these two documentations, but no clear tutorial:

It looks like I need to create a project at https://console.developers.google.com, then Enable an API (which one?).

It looks like I need to set at least all these settings (through code or through App.Config file) and also manage some tokens expirations:

AdWordsUser adWordsUser = new AdWordsUser();
AdWordsAppConfig adWordsUserConfig = (AdWordsAppConfig) adWordsUser.Config;
adWordsUserConfig.ClientCustomerId = "123-456-7890"; 
adWordsUserConfig.OAuth2Mode = ? APPLICATION or SERVICE_ACCOUNT ?
adWordsUserConfig.DeveloperToken = "????"; // MUST BE SET
adWordsUserConfig.OAuth2RefreshToken =  "????";
adWordsUserConfig.OAuth2ClientId =  "????";
adWordsUserConfig.OAuth2ClientSecret =  "????";

But I have no idea how to obtain all these IDs?

Thanks


Edit:

After activating the API Ad Exchange Buyer API (no idea if this is the one required) I have been able to obtain some ID for credential.

While this give me what to put for: OAuth2ClientId, OAuth2ClientSecret I am still laking a lot of info to get started.

enter image description here

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
  • 1
    Nuget client lib: https://www.nuget.org/packages/Google.AdWords/ I have a tutorial that uses Google Drive with a sample project at the bottom. It might help you understand the Oauth2. http://www.daimto.com/google-oauth2-csharp/ – Linda Lawton - DaImTo Sep 11 '14 at 07:56
  • Linda, your blog post tutorial looks very promising but you are not using https://github.com/googleads/googleads-dotnet-lib (which sounds normal since you are targeting Drive). So I don't have access to types like GoogleWebAuthorizationBroker.AuthorizeAsync or UserCredential. Is "Ad Exchange Buyer" API the right one to upload Offline Conversion? How to map settings I got to adWordsUserConfig settings? How to deal with token lifetime? Thanks – Patrick from NDepend team Sep 11 '14 at 08:26
  • 1
    I haven't actually played with the adwords API, I assume that its like the other Google APIs. with the exception that it appears to be soap / xml. I don't have access to any adwords accounts so its hard for me to help more, because I cant play with it myself. email me if you want maybe we can figure it out together. – Linda Lawton - DaImTo Sep 11 '14 at 08:47
  • Sounds like I need first to register this way: https://developers.google.com/adwords/api/docs/signingup Google is definitely not doing things easy for its clients :/ – Patrick from NDepend team Sep 11 '14 at 09:31
  • 1
    there are test accounts maybe I can play with this. Looks like you need to apply now takes a week before you will hear from them. https://developers.google.com/adwords/api/docs/test-accounts – Linda Lawton - DaImTo Sep 11 '14 at 11:12
  • Facing the same issues, if you figured this out, would be awesome if you could answer your own question :) – eselk Jan 20 '15 at 22:13
  • No w'er not done yet :( – Patrick from NDepend team Jan 22 '15 at 04:36

0 Answers0