Google Calendar - Find Another User's Timezone - google-api

Is it possible using the Google APIs to retrieve the timezone for another user?
For example, using the Python Client Library, it's possible to get a user's timezone with something simple like the below...
#build calendar service_calendar
service_calendar = build('calendar', 'v3', credentials=credentials)
# Get the user's timezone
timezone = service_calendar.settings().get(setting='timezone').execute()
...but this can only be used to retrieve the timezone for the credentialed user.
If I'm in a same-domain organization where things like calendar free/busy are shared, is it possible to determine the timezone of another user (whose credentials I don't have) by calling something similar?

Related

Google API to view any user's calendar list

I am using Google API to try to view a user's calendar list, mainly the shared calendars a user had access to. But according to the Google Calendar.List api , I can view only the logged user's calendar. So I wanted to ask if there is a way around this.
The use case that I am working on requires removing any shared calendars of a user whose status has been changed to suspended.
Thanks
DS

Google API: Using OAuth to get the user's country

I'm trying to retrieve the user's country through Google's API. Using 'https://www.googleapis.com/plus/v1/people/me', I'd suspect that the user's country would be returned but it does not. I've looked through the docs and StackOverflow, all the the results are about retrieving the user's location using Google Maps, which I'm not interesting in.
The information is inputted when creating an account at the bottom here:
Is there any way to get this information from Google? Thanks.

Yammer REST endpoint to get user by full name

I'm working on a migration Product that migrates data in to yammer. I want to match the user on source to user on target based on full name. How do I retrieve user from Yammer based on Full Name? There is one REST endpoint to get user by email. Is there something similar to this for user Full Name ?
It's not possible to do this with the User API as it only supports getting a user by ID or email. You might want to look at the Autocomplete API, but it might be quicker to use the Data Export API and find the user in the users.csv file. It's hard to provide recommendations when you don't explain what you app does.

add calendar to another user's calendar list

Not sure if this is possible or if anyone has managed to do this. I have user with super admin access, with which I can create a new user for my domain. However I also want to add a couple of calenders to the created user's calendar list. When I create a user I authenticate using my super admin, but then I can't add a calendar to the user's calendar list since I am not logged in as the user. Is it possible to do this as the super admin, or do I have to logout and authenticate as the created user in order to add calendars to their list? This is the base url to which the post request is made:
https://www.googleapis.com/calendar/v3/users/me/calendarList
in the place of me could I pass in the id of the user? I couldn't find any parameter in the documentation with which I can specify the user to whose list I want to add a calender.
Thanks
Two options:
Each user much login to google calendar and share thier calendar to a single user. You can then use this account to update their calendars. Note that google has limitations to how many calendars and request you are allowed before the account goes to read-only mode.
Buy a google apps domain (5$per user per month) and create a service account at console.developers.google.com. Create a project and give it domain wide delgation at admin.google.com. In Apps engine you should be able to give access for admin to modify all users calendars.
No matter what case you choose, you also need to enable CalendarAPI at dev console site. Now with private key created from website request OAuth2 access token, where sub field is set for the users that you want to change calendar for. With returned access token use CalendarAPI to modify calendar.
Sry for bad english and short description, i'm in a hurry. /conner ;)

Ruby - how to get current user's time?

I am playing with a timezones and I have a simple registration form. after user's registration, I would like to user display his current time, how to do that?
You can not do it only with Ruby, because such information isn't available on the server side.
1) If you know the user's location, you can do geo locating and determine the timezone. But it could be a problem if ip range you got from geo database has a few timezones.
2) Another solution, you can use javascript to help. So, with javascript you can calculate timezone and set it as cookie, and then access with Ruby from the request object. (How to get timezone with Javascript)
You could ask the user for their current timezone during registration and persist it with their user details.
ActiveSupport (included as part of the Rails API) has a great way to deal with timezones, you can convert the current time to a time in a different timezone using *in_time_zone*.
As an example
Time.now.in_time_zone("America/Guyana")
Time.now.in_time_zone(8)
Where the time_zone key can be found via this API document: http://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html
See TimeWithZone for more info, http://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html#method-i-in_time_zone.

Resources