Skip to content

Latest commit

 

History

History
122 lines (103 loc) · 7.03 KB

File metadata and controls

122 lines (103 loc) · 7.03 KB

Below you will find a short and detailed summary on how to set up your google contacts.

  • If you set up this option, your reports will be more richer with contact names information. Highly recommended!

Summary:

Steps to create a Google project and ClientID and ClientSecret

  1. Create a Google project.
  2. Enable Contacts API.
  3. Create oAuth credentials i.e. Client ID and Client Secret keys
  4. Save the keys as a JSON file in your Secrets directory (this folder).
    • You dont have to rename the long file name (but if you want, you can. Just dont change the file extension. Keep it as .json).
    • All the files in Secrets directory (Except readme.md) are ignored. So you dont have to worry about accidentally publishing it on say github.
    • Thus your secrets are safe on your computer (as long as your computer is safe from viruses i.e.)
    • Do not add any other file here (atleast not a json file).
  5. Using your clientId and Client secret Key, get a refresh token (Detailed steps are given below) .
    • Add this refresh token to your secrets json file with a key value pair
    • looks like this (updated with dummy values): "refresh_token": "1//04abcdefghijklmopqurstuv-abcdefghijklmopqurstuv_zydfsfsdfsfsdfsdfdsfsnT68",)
    • Later goal is to eliminate this step, so that you can just work with client id and client secret. Until then use this.
  6. To ensure that all your phone contacts are synced on google contacts, sync your contacts with google contacts.
    • If you are on Iphone, follow this one time instructions to sync your contacts from icloud to google contacts
    • If you are on android, checkout how to sync your contacts manually to google contacts (there are many videos on youtube. I dont have android so cant test this.)

Detailed:

Step by step instructions.

  1. Create a google project


  1. Enable Contacts API


  1. Create Credentials (oAuth keys: Client ID and Client Secret keys) Either from the ContactsAPI page as shown below._

    You can also view this anytime from the credentials page (or even set up from there as shown below)_


  1. Save the keys as a JSON file in your Secrets directory (this folder).


  1. Get a refresh token using client id and client secret and add to secrets json file.

    • Go to settings and check option "use your own OAuth credentials".
    • Provide your client Id and client Secret and Close. Curtesy reference
    • Oops we get an error. We forgot to give a redirect url while creating our tokens.
    - Go to your project (say MyProject). Click on Credentials and now click on the edit icon to edit the details in oAuth 2.0 ClientID. - Now go back and try again with 'Step1' above to "Contacts v3" -> "https://www.goggle.com/m8/feeds/ and authorize APIs. - This time you should be able to get an authentical code as shown below. First it will ask for Google signin.
    • Exchange the authentication code for tokens.
    • Copy the refresh token from here and add to client-secret_****.json
    - We are all set now to get the contacts from Google APIs.

  1. Sync all your icloud contacts to google contacts.
    • You are good to go with your setup!

Reference

To generate authentication tokens manually, use this website

Google Developers

Powershell scripts to work with oAuth tokens