Create a Project
1. Sign into your Gmail Super administrator account into https://console.developers.google.com/
2.Choose an option:
- If you haven't used the GCP Console before, agree to the Terms of Service and click Create Project.
- If you have used GCP Console before, at the top of the screen next to your most recent project name, click Down to open your projects list.
2. Then, click New Project
3. Enter a project name and click Create. In my example I am calling it "GmailServiceAccount"
Enable API Sets
4. From the Drop down menu again make sure your Project is selected and click the ENABLE APIs AND SERVICES
5. Search and Enable the following API sets Gmail API, Google Calendar API, Contacts API .
Example shown below enabling Gmail API
6. Once enabled you will need to go back by clicking "APIs & Services" to enable the others (Gmail API, Google Calendar API, Contacts API).
Repeat step 5 for each of the remained of the services listed (Gmail API, Google Calendar API, Contacts API)
Create a Service Account User
7. In the top-left corner of the GCP console, click Menu . Then IAM & admin and then Service accounts
8. Click on the "CREATE SERVICE ACCOUNT"
9. Fill in a name and description and click CREATE
10. Grant Project Owner Role and click Continue
11. Click Create a Key
12. Make sure it is JSON (It is by default) and select CREATE.
13. The JSON file should be downloaded to your computer you should store this securely as it provides access to your resources.
14. Once the file is downloaded click "DONE" button
Enable G Suite domain-wide delegation
15. Select you newly created Service account and select "Edit".
16. On the Edit screen click on the "SHOW DOMAIN-WIDE DELEGATION" and then checkbox of Enable G Suite Domain-wide Delegation give it a Product name. Example shown uses "Ebsta"
Then click on the Save Button to save your changes.
Enable Service Accounts with Gmail
17. Log into Gmail select the Admin panel you generally will need to scroll to find it.
Click on the Security panel
Scroll down to click on Advanced Settings and then click on "Manage API client access"
You now need to set the Client Name and the Access and then click Authorize
The Client Name should be the unique Id of the service account client. This can be found either back in the Admin console when you edit the Gmail Service Account or by opening the JSON private key file and extracting it from there.
or From your private key file which you can open with your favorite editor.
The Access should be given for the specific services. This is Gmail.
Give it 5 mins for the change to go through the system on Gmail side.
You should be all setup to test now with Gmail Service Account and ready to upload your JSON file to Ebsta to connect your Mailboxes.