Question

Trying in vain to access the Directory API in the Google Admin SDK (Reference). Upgrading the "google-api-python-client" package doesn't resolve it, as the Downloads > Installation > Python link instructs.

I also don't see in the documentation where it lists the programmatic name of the API, so I'm assuming it's "directory", but have also tried "directory.admin" and "admin.directory." I get the following exception when I try to run my test code:

apiclient.errors.UnknownApiNameOrVersion: name: directory  version: v1 

Could someone please assist with what I may be overlooking? Unfortunately, the "Quickstart" that provides the shell to access the API seems to be broken (Reference). When I select Python > Command-Line > Configure Project, I get an error that states "Sorry, unable to configure a project right now."

Here's the pertinent piece of code I'm using in my custom Directory library class:

class Directory(object):
    def __init__(self, httpConnection):
        self.service = build('directory', 'v1', http=httpConnection)

Is this just a case of no client library being available yet for the API? If so, when might that be available?

Was it helpful?

Solution

There's an issue where this new API isn't appearing in the list of supported APIs, but it is indeed there, you can access it from:

service = build('admin', 'directory_v1')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top