New Google Drive Directory APIs error out: Bad request -


i using below piece of code list domain users in simple console application

        var certificate = new x509certificate2("d:\\3acf2c2008cecd33b43de27e30016a72e1482c41-privatekey.p12", "notasecret", x509keystorageflags.exportable);          var privatekey = certificate.export(x509contenttype.cert);         var provider = new assertionflowclient(googleauthenticationserver.description, certificate)         {             serviceaccountid = "877926787679-b7fd15en1sh2oc65e164v90cfcvrfftq@developer.gserviceaccount.com",             scope = directoryservice.scopes.admindirectoryuserreadonly.getstringvalue(),             serviceaccountuser = "user1@05.mygbiz.com"         };          var auth = new oauth2authenticator<assertionflowclient>(provider, assertionflowclient.getstate);          directoryservice dirservice = new directoryservice(new baseclientservice.initializer()         {             authenticator = auth,             applicationname = "my app"         });         users users = dirservice.users.list().execute(); 

execute() method errors out saying bad request.

questions:

  1. how overcome issue?
  2. does admin sdk support trial version of google app account?
  3. i have updated service account client id in google console , updated in admin console below scopes https://www.googleapis.com/auth/admin.directory.group https://www.googleapis.com/auth/admin.directory.user , set api access check box. missing in settings?

like jobe said, should include domain parameter.

happy_user = service.users().list(domain='mydomain.com').execute()

this has worked me.


Comments