google-admin-sdk

Use bash curl with oauth to return google apps user account data? [closed]

旧时模样 提交于 2019-11-26 22:25:14
I am looking for a fairly simple method to use curl to return information about a batch of users accounts (like createddate or lastlogin) in google Apps. I am very inexperienced with curl and the Google Apps api's. Does anyone know of a good introductory article on how to use curl with Oauth to request user account data? Thank you in advance! This isn't easily achieved as OAuth 2.0 and JSON aren't easily handled by Bash. Having said that, here's a basic version that'll give you the data you're looking for. The greps could use some cleanup but then again, interpreting JSON with grep is a really

Converting string to web-safe Base64 format

故事扮演 提交于 2019-11-26 16:57:27
问题 I am testing how to update user picture using the Admin SDK Directory Service with Google Apps Scripts with the following function: function updatePhoto(){ var fileId = 'XXXXXXXXXXXXXXXXXXX'; var b = DocsList.getFileById(fileId).getBlob(); var encoded = Utilities.base64Encode(b.getBytes()); encoded = encoded.replace(/\//g,'_').replace(/\+/g,'-').replace(/\=/g,'*'); AdminDirectory.Users.Photos.update({ "photoData": encoded },'harry.potter@abc.edu.hk'); } However, it doesn't always work.

Google_Service_Directory - (403) Not Authorized to access this resource/api

吃可爱长大的小学妹 提交于 2019-11-26 16:45:40
I have a problem just using an example of actual version of PHP api, and using the "service-account.php" file of examples folder. the original is for show the "Books API", and with my personal credentials configuration it works well, but in my xcase I need to access by directory.groups.get service to have the list of members accounts of a google groups mail list, so I change the original code in this: <?php session_start(); include_once "templates/base.php"; /************************************************ Make an API request authenticated with a service account. *****************************

Google_Service_Directory - (403) Not Authorized to access this resource/api

此生再无相见时 提交于 2019-11-26 04:28:49
问题 I have a problem just using an example of actual version of PHP api, and using the \"service-account.php\" file of examples folder. the original is for show the \"Books API\", and with my personal credentials configuration it works well, but in my xcase I need to access by directory.groups.get service to have the list of members accounts of a google groups mail list, so I change the original code in this: <?php session_start(); include_once \"templates/base.php\"; /***************************