title: Using Google People API with Service Account
body: <p>I'm using the Google People API to access my contacts.</p>
  
  <p>I activated it in the Google Developers Console and created a project, a service account (ending with <code>....iam.gserviceaccount.com</code>) and a key for authentication which is stored in JSON format.</p>
  
  <p>When I access the contacts, it seems to take the contacts of my service account address rather than my Google account which results in an empty list.</p>
  
  <p>How can I tell the API to use my account rather than the service account?</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>from google.oauth2 import service_account
  from googleapiclient.discovery import build
  # pip install google-auth google-auth-httplib2 google-api-python-client
  
  SCOPES = ['https://www.googleapis.com/auth/contacts.readonly']
  KEY = '~/private.json'
  
  credentials = service_account.Credentials.from_service_account_file(
      KEY, scopes=SCOPES)
  service = build(
      serviceName='people', version='v1', credentials=credentials)
  connections = service.people().connections().list(
      resourceName='people/me', personFields='names').execute()
  
  print(connections)
  # result: {}
  </code></pre>