Preparing Gmail Account
To configure your company Gmail for AGSync Gmail administrator should complete a number of steps. We need to create special account that is able to provide API access and impersonate as all users involved in the sync process. This account is accessed via special API access keys.
Log into the Google Developers console as Google apps domain administrator.
Create a project. We recommend you to call the project
And press “Create”. This may take a while:
- If if fails, you may need to enable Google Cloud Platform by at https://admin.google.com/ac/appslist/additional and then re-try the project creation.
Go to Home->IAM Admin->Service Accounts and choose Create Service Account:
Finally list of service accounts appears:
New service account with unique name (in this case it is:
email@example.com) has been created.
Create Service Account Key:
P12 , Create:
It is working for a while:
And then downloads a file:
You need to save it somewhere – it will later be needed to configure AGSync connection.
Go back to the list of Service Accounts and choose Manage Details for a new account:
Write down service account email address – it will be needed later. I.e. in our case it is: firstname.lastname@example.org
Now we need to enable delegation for new service account.
Tick Enable G Suites Domain-wide Delegation checkbox and define product name for consent screen (i.e. agsync).
After pressing Save copy Client ID for later use (in our case it is 102968100623716713154):
So, as a result of this step we recorded two things:
Service Account email address: email@example.com
Client ID: 102968100623716713154
Downloaded file agsync-307309-0abd09836e88.p12 saved to desktop.
We will need them later.
You need to enable following 4 APIs: Calendar API, Contacts API, Gmail API and Tasks API for the service account.
Go to Home->API & Services->Dashboard:
Click Enable APIs and Services:
Choose Google Calendar API:
And enable it:
Now repeat the same for Contacts API, Gmail API and Tasks API (i.e. return to Home->API & Services->Dashboard, choose Enable APIs and Services, find and enable each of the APIs).
Finally the list of enabled APIs should at least contain following 4 items:
Now go back to Admin console:
Scroll down and choose API Controls:
Now choose Manage Third-Party App Access:
Choose Configure new app->OAuth App Name or Client ID:
Search an app by Client ID recorded earlier:
Finally, press Configure.
If everything is OK then Authorized API client now appears in the list:
Final step is to use collected information in the AGSync connection settings.
All we need for connection is Service account email and an Account Key collected on the Step 3: