How to receive the logged in user info

211 views
Skip to first unread message

PatrickvKleef

unread,
Jun 12, 2012, 3:18:24 PM6/12/12
to adwor...@googlegroups.com
Hi!

I'm new with using the Google Adwords API. I'm using OAuth to authenticate users.
I would like to receive user information (emailaddress, name, etc.) when the user is authenticated with OAuth.

Can somebody help me with this?


PatrickvKleef

unread,
Jun 12, 2012, 3:25:16 PM6/12/12
to adwor...@googlegroups.com
 Forgot to mention, I'm using OAuth 2.0.


Op dinsdag 12 juni 2012 21:18:24 UTC+2 schreef PatrickvKleef het volgende:

PatrickvKleef

unread,
Jun 13, 2012, 5:45:28 AM6/13/12
to adwor...@googlegroups.com
Does somebody knows how to do this??

Anash P. Oommen

unread,
Jun 14, 2012, 1:18:12 AM6/14/12
to adwor...@googlegroups.com
Hi Patrick,

AdWords doesn't contain information about the user name, profile image, etc. What it has at best is the company name of the Advertiser account and login email. You could use ServicedAccountService to retrieve these information. See https://developers.google.com/adwords/api/docs/reference/latest/ServicedAccountService for details.

In case you are looking for the profile of the logged in user, that's outside the scope of AdWords API. This link might help you: http://stackoverflow.com/questions/7130648/get-user-info-via-google-api

Cheers,
Anash P. Oommen,
AdWords API Advisor.

PatrickvKleef

unread,
Jun 14, 2012, 2:56:14 AM6/14/12
to adwor...@googlegroups.com
Thanks for your response Anash!

Maybe it's a good idea to explain what I want do.
I would like to give certain users access to the web application I'm building. When using the Adwords API
client library it is possible to login users with OAuth, but the problem is that not everybody with
a google account should have access to the web application. So I would like to receive the email (and other user information only for displaying) of the user
and than check if the user has access rights. Is there a better way of give users access to your
web application that's using the Adwords API?

The user accounts that can access the web application has access to google adwords accounts (one or more client customer Ids).

Greetings!



Op donderdag 14 juni 2012 07:18:12 UTC+2 schreef Anash P. Oommen het volgende:

PatrickvKleef

unread,
Jun 18, 2012, 3:49:00 AM6/18/12
to adwor...@googlegroups.com
Hi Anash,

Could you please help me with my last reply.

Thanks.

Op donderdag 14 juni 2012 08:56:14 UTC+2 schreef PatrickvKleef het volgende:

Danial Klimkin

unread,
Jun 20, 2012, 4:36:18 AM6/20/12
to adwor...@googlegroups.com
Hello PatrickvKleef,


It is not possible to retrieve the logged in user email address via AdWords API when using OAuth. I suggest to use clientCustomerId instead.

You can obtain the list of customer IDs the logged in user has access to via ServicesAccountService or InfoService and use them to whitelist users to access your application.


-Danial, AdWords API Team.

PatrickvKleef

unread,
Jun 20, 2012, 6:20:27 AM6/20/12
to adwor...@googlegroups.com
Thanks for the response Danial.

Multiple users can have access to a single clientcustomerId and I would like to distinguish them by display there name and emailaddress. Is it possible to use the Google API (UserInfo) in combination with the Google Adwords API and how can I do this?

Op woensdag 20 juni 2012 10:36:18 UTC+2 schreef Danial Klimkin het volgende:

Danial Klimkin

unread,
Jun 21, 2012, 9:53:51 AM6/21/12
to adwor...@googlegroups.com
Hello PatrickvKleef,


This should be possible by including several scopes in your OAuth request and using other API to obtain the user information. Please check with the relevant API documentation as this is out of scope for the AdWords API Team.


-Danial.
Reply all
Reply to author
Forward
0 new messages