...
Go to: https://admin.google.com/
Login using the Super Admin Credentials.
Under “Security” go to “API Controls” and click “Manage Domain Wide Delegation”
Click on “Add New” and enter the unique ID copied in the above step inside the Client ID textbox.
Add the following list of scopes - comma separated:
https://mail.google.com/
, https://www.googleapis.com/auth/gmail.readonly
, https://www.googleapis.com/auth/gmail.settings.sharing
, https://www.googleapis.com/auth/gmail.settings.basic
, https://www.googleapis.com/auth/gmail.
addons.current.action.composehttps://www.googleapis.com/auth/gmail.modify
modify, https://www.googleapis.com/auth/gmail.labels
, https://www.googleapis.com/auth/gmail.compose
, https://www.googleapis.com/auth/gmail.send
, https://www.googleapis.com/auth/gmail.insert
, https://www.googleapis.com/auth/contacts.other.readonly
, https://www.googleapis.com/auth/contacts.readonly
, https://www.googleapis.com/auth/contacts
, https://www.googleapis.com/auth/drive.readonly
, https://www.googleapis.com/auth/drive.file
, https://www.googleapis.com/auth/drive
, https://www.googleapis.com/auth/calendar
, https://www.googleapis.com/auth/calendar.events
, https://www.googleapis.com/auth/cloud-platform
, https://www.googleapis.com/auth/admin.directory.user.security
, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/gmail.addons.current.action.compose
Once done, click “Authorize”.
...