google-apps-scriptgoogle-apps-for-education

Through Google Apps Script get all user information on a spreadsheet of a google apps domain


I want to retrieve all the user data of my domain in a spreadsheet, so far i am able to retrieve first name email id last name ,storage quota and password change when next time i log in. But I am unable to get details like Apps enabled,License,Contact Sharing,Email Routing - Google Apps Email,Email Routing - Inherit routes , Mobile Devices,Date Snapshot,Date Change,Change Comment,Action done by etc. I am basically not able to get any API for this all i am getting some JSON or XML codes but what if i entirely want it in GAS only no other files.


Solution

  • Some of what you are looking for is best requested via the Admin SDK. You may want to also check out other Google Data APIs in more detail, you could put together some good reporting tools.

    Many of the APIs can be used in Google Apps Script by using the UrlFetch service. There's an OAuth flow built in that service that is quite nice for OAuth 1 flows, and it's not too bad to create a decent Google OAuth 2 flow with UrlFetch as well.

    Then you can make authenticated requests to those APIs and handle the responses accordingly with Apps Script.