The Profiles Data API allows client applications to retrieve and update profile information for users in a Google Apps domain. Each user profile is stored in the owning user’s Google Account, but it can be modified only by an administrator of the user’s domain.
So what we are going to do, we will fetch user’s profile information from an admin account. For this, we will write a script at admin account of google Apps Domain. Firstly this script will do authorization via Oauth Authentication.
Here all the fields are in try..catch block because if any field entry is empty then that field will not be shown in output and when we will try to fetch that field it will be shown as undefined.