0
votes

I need to connect to google adwords API.

I do not need to authenticate 3rd party users.

I am the only user of my system.

There's only 1 program that runs in my system, serving only myself.

Previously, all I had to do was supply some sort of ID, password, and client version.

Now i need to provide OAUTH, refresh token, other tokens, user agents, etc. etc.

Is there a way NOT to use OAuth?

The reasons for NOT using OAUTH are:

  1. i don't need to authenticate any 3rd party.
  2. i don't know what is "user agent" in this context
  3. i can't get a refresh token:
    1. i'm running "generate_refresh_token.py",
    2. it asks me to get a token at (i use my real client-id, not xxxx): https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=xxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fadwords.google.com%2Fapi%2Fadwords
    3. that url redirects to a 400 error page: "Error: redirect_uri_mismatch"
    4. but which uri it should match?

EDIT 2:

the refresh token requires specific settings "installed application". Doh. And it needs to be re-coded into "generate_refresh_token.py" :P

I'm still off with "user agent"

3
Which instructions were you looking at? I just recently followed the ones here: developers.google.com/api-client-library/python/guide/aaa_oauth and didn't run into any problems.dano
@dano - i'll update my questionBerry Tsakala
Have you looked at this re: "redirect_uri_mismatch"?: stackoverflow.com/questions/11485271/…dano
Have you set your url here: console.developers.google.comuser3189157

3 Answers

1
votes

You aren't forced to migrate to OAuth2 until the end-ish of July (Here's the details from Google)

I sympathize, learning about OAuth2 was one of the most difficult and frustrating aspects of using the Adwords API, most resources out there are only hour long dull youtube videos where they use strange metaphors and get too difficult too fast.

The user-agent in all web contexts I've seen means the tool I'm using to make the HTTP request. When I set the user agent in my python code I just set it to "Adwords Test". When I click on the link you provided in my browser, my browser sets it to whatever user-agent string it uses.

The thing that really helped me understand what was going on was the OAuth2 playground from Google.

1
votes

I think the user agent field is optional as mentioned in the link below. I have been working with the API's without changing the "user agent" field. How to generate the USER_AGENT for AdWords API script

0
votes

the refresh token requires specific settings "installed application", and not (whatever was there that confused me)

And it needs to be re-coded into "generate_refresh_token.py"

the "user agent" is irrelevant in my case