/
Google JSON Key

Google JSON Key

To access files on your Google Drive, you can create a Google Drive external integration for which you will need to first create Google JSON Key credentials with a service account JSON private key.

Prerequisites

Before creating Google JSON Key credentials, you need to ensure that you have configured:

  • a service account in Google Cloud;

  • the authentication file related to this service account that contains the private key in JSON format.

This private key can then be used when creating Google JSON Key credentials.

Enabling Google Drive API

The first step consists of enabling the Google Drive API.

  1. Go to Google Cloud console

  2. Search for the Google Drive API and click on it.

  3. Click Enable to ensure the API is ready for use.

image-20240415-142412.png

Creating a service account

Before creating a service account, ensure that you have been attributed the IAM role on the project. This will allow you to manage service accounts.

  1. Go to Google Cloud - IAM & Admin - Service accounts;

  2. Select the project in which you want to add a service account;

image-20240415-142826.png
  1. Click CREATE SERVICE ACCOUNT;

image-20240415-143015.png
  1. Specify the service account details, such as the name, the ID, and the description.

image-20240415-143404.png
  1. Click CREATE AND CONTINUE.

  2. Select the Viewer role for this service account (select Basic > Viewer), then click Continue.

image-20250310-143114.png
  1. (Optional) If needed, you can grant specific users access to the service account.

image-20240415-143944.png
  1. Click Done to finish the creation of the service account.

image-20240415-144217.png

Creating a JSON service account key

  1. Click on the service account to access its details.

image-20240415-144447.png
  1. Navigate to the KEYS tab.

  2. Click ADD KEY, then Create new key.

image-20240415-144648.png
  1. Choose JSON as the Key type to create.

image-20240415-144755.png
  1. The JSON will be automatically downloaded and can be found in your Downloads folder.

Sharing Google Drive folders to the service account

The last step needed to be able to access the Google Drive files is to share the folders you want to access via the Agentic platform to the Service Account:

  1. Go to Google Drive.

  2. Navigate to where your folder is.

  3. Case 1 - Sharing a folder located in “My Drive”:

    1. Click the More actions (three vertical dots) icon, then Share > Share.

    image-20240416-080137.png

    b. Specify the email address of the service account and give it the Viewer access.

    c. Click Send.

    image-20250407-131126.png

    d. Click Share anyway to confirm.

    image-20240416-080820.png
  4. Case 2 - Sharing a folder located in Shared drives:

    1. Make sure the drive itself is not shared with the Service account. You can check this by clicking the More actions (three vertical dots) icon and clicking Manage members.

    2. Share the folder(s) or files of the drive with the service account:

      1. Click the More actions (three vertical dots) icon, then Share > Share.

        image-20250407-132720.png
      2. Specify the email address of the service account and give the Viewer access.

      3. Click Send directly, or unselect the Notify people box and click Share.

        image-20250407-132821.png
      4. Click Share anyway.

    3. Only applicable if the service account is external to your organization:

      1. Go to the Shared drives main view where you can see the available drives and click the More actions (three vertical dots) icon on the drive you want to share, then click Shared drive settings to configure the parameters.

        image-20250407-133306.png
      2. If the service account is not a member of the shared drive and you want it to access the files, check the Allow people who aren’t shared drive members to access files box.

        image-20250310-144058.png

You will need to repeat the sharing process for every file/folder you want to access via the bot.

Adding Google JSON Key credentials

Below are the steps to create new Google JSON Key credentials:

  1. Go to Administration > Credentials & models.

  2. Click the Add credentials button;

  3. Click the Google JSON Key card;

  4. Name your credentials, e.g. Google JSON Key for Google Drive;

  5. Select who to share the credentials with. This will determine who can use your credentials in the data sources. If you want to keep these credentials private, select Only me. If you want to share them with other builders, select Builders.

  6. Select the scope(s) of the API call. They correspond to a permission level. Usually, you can keep the value by default.

  7. Provide the Content of the private key (JSON) to use for the connection. Just copy all the content of the JSON authentication file and paste it into this field. Below is an example of a JSON authentication file:

{ "type": "service_account", "project_id": "example", "private_key_id": "vsjrebkmbvlreojgk78590809065R65TR8IJK", "private_key": "-----BEGIN PRIVATE KEY----- ezfoijrebgjvmrekoqjoire87568FYGJOI76........-----END PRIVATE KEY-----", "client_email": example.iam.gserviceaccount.com", "client_id": "9886678723510384395", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/example.iam.gserviceaccount.com", "universe_domain": "googleapis.com" }
  1. Click Add credentials on the bottom right of the page to finalize the creation.

image-20250324-092430.png

The new credentials are now available in the Credentials list. You can now use them when creating a new Google Drive external integration.

Video tutorial: How to add Google JSON Key credentials

What’s next?

Learn how to create a Google Drive external integration that uses your credentials by reading this page: Google Drive.

Related content