0

When a user authorizes with my Glassware they provide these permissions to my software:

enter image description here

Although it isn't lining up in the image, the more info is from the top "basic information about your account" permission. It mentions timezone which I would like to access to customize global event time stamps for display to people who don't grok GMT.

I am surprised I can't find the endpoint for this anywhere in the docs.

Anyone know where this might be, or is this a UI bug in the permissions dialog and really we can't see that information? Or perhaps is this only available to trusted partners like NYT and CNN, etc, and not to mere explorers.

I already tried variations on the timeline GET endpoint:

https://www.googleapis.com/mirror/v1/timeline

But substituting in various version of user/users and account/accounts and adding in the user id for a registered user, which I can get through this bit of Java code:

String userId = AuthUtil.getUserId(req);

Any help appreciated!

(Note: I won't give credit to anyone suggesting I get the user's location and use a Google API to reverse look up their location's timezone--see the issue tracker for problems with that approach not to mention I want the timezone the user set in their account not where they are)

Mark Scheel
  • 2,963
  • 1
  • 20
  • 23

1 Answers1

1

The more information screen is coming from the https://www.googleapis.com/auth/userinfo.profile scope: with a token approved for this scope, you can send authorized requests to the userinfo endpoint:

GET https://www.googleapis.com/oauth2/v2/userinfo
Authorization: Bearer <OAUTH_2_TOKEN>

However, you will only be able to retrieve the timezone information if the user set it in their profile and allowed sharing.

In Java, retrieving this information is done with the OAuth2 API.

Alain
  • 6,044
  • 21
  • 27
  • Amazing! Thanks Alain. That gives me id, name, given_name, family_name, link, picture, gender, birthday and locale. But no timezone. The user in question has a timezone set in his primary calendar settings, where do I instruct my users to set timezone so I can have access to it? I poked around profile settings but could not find anything timezone related. – Mark Scheel Jun 25 '13 at 04:03
  • Still hoping for a response, I notice the example JSON array here - https://developers.google.com/accounts/docs/OAuth2LoginV1 - is also missing timezone. Adding the "google-account" tag, maybe one of those users can help. – Mark Scheel Jun 26 '13 at 04:48