title: gsuite service account for directory api returns http 400 errors: Bad request/Invalid input
body: <p>I have started to develop some apis to create users in my G suite directory.
  I followed the <a href="https://developers.google.com/identity/protocols/oauth2/service-account" rel="nofollow noreferrer">service account tutorials</a> along with the <a href="https://developers.google.com/admin-sdk/directory/v1/quickstart/python" rel="nofollow noreferrer">Directory tutorials</a> for python. The code I have is very simple just to test out how it will work.</p>
  <pre class="lang-py prettyprint-override"><code>from google.oauth2 import service_account
  from googleapiclient.discovery import build
  SCOPES = ['https://www.googleapis.com/auth/admin.directory.user']
  SERVICE_ACCOUNT_FILE = 'file'
  creds = service_account.Credentials.from_service_account_file(
      SERVICE_ACCOUNT_FILE, scopes=SCOPES)
  service = build('admin', 'directory_v1', credentials=creds)
  results = service.users().list(customer='i am not sure what customer is', maxResults=10, orderBy='email').execute() 
  #this line produces the error.
  #Vscode also states the service has no member users. But I did install all #the libraries
  users = results.get('users', [])
  print(users)
  </code></pre>
  <p>The documentation to me is unclear about most things. When I run this I get</p>
  <pre><code>googleapiclient.errors.HttpError: &lt;HttpError 400 when requesting https://www.googleapis.com/admin/directory/v1/users?customer=students&amp;maxResults=10&amp;orderBy=email&amp;alt=json returned &quot;Bad Request&quot;&gt;
  </code></pre>
  <p>When I change customer from <code>my_customer</code> to something else I get <code>Invalid Input</code>.
  Any suggestions to what may cause this error and preferably how to work with this api via a service account?
  Now I did enable the <code>directory api</code> and create the service account and downloaded the service account file as well. Am I missing a step?
  I would also prefer if someone has a better documentation that I was unable to find.</p>