Question

I'm trying to provision (among other things) groups for our Google Apps domain, using python. I'm also attempting to using OAuth to authorise my application. The API documentation for Python seems to be missing or broken links. But from searching through the code, it seems I can't use the new (GDClient) APIs as (among other things) I can't get a list of group owners (which I can do in the older GDataService API). And the API for group settings seems to be either the old GDataService, or the even newer apiclient API, but I can't perform basic group provisioning using that API. So it seems I'm stuck using the GDataService API. However, I can't get my head around how to use OAuth for GDataService objects - I can create an oauth token using oauth2client, but can't authorise a GDataService object using this token.

Any pointers as to where to go from here? I'm struggling to believe how messy this all is

Was it helpful?

Solution

The provisioning API is still on the older GDataService API. It is being replaced by the new API called directory api (check out here https://developers.google.com/admin-sdk/)

If you just want to at least get start and familiar with the OAuth flow. You should check out this documentation for the Python API client library: https://developers.google.com/api-client-library/python/start/installation

Try the quick start. All you have to do is select the API you want to use, and select the platform (I usually just picked command line). Click 'Configure Project'. Make sure you are already logged in you Google Apps account that you used to create your project in API console. Select your API project and then finally download the whole package.

Remember to replace your client secret file and just run the sample python code. It will do all the OAuth flow for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top