Authorization Type

Carbon uses OAuth 2.0 to connect to Google Cloud Storages buckets.

Authorization Flow

Log into your Google Drive account to provide access to your Google Cloud Storage buckets. Once you’ve successfully authenticated your account, you can select files and folders directly.

Via Carbon Connect: Optionally you can input the credentials directly via the Carbon Connect component.

Configuration

Custom OAuth Credentials

Custom OAuth credentials is only required for customers who enable white labeling.
  1. Go to APIs and Services > Enabled APIs and Services in your Google Cloud console, then click on the button titled ENABLE APIS AND SERVICES and enable Cloud Resource Manager API (cloudresourcemanager.googleapis.com).
  2. Then create an OAuth Client ID in the Credentials section under Cloud Resource Manager API. Select Web Application as the Application type and give it an identifiable name for your reference.

  1. Add https://api.carbon.ai as the Authorized JS origin and https://api.carbon.ai/integrations/gcs as an Authorized redirect URI. You can also opt to use a custom CNAME record pointing to https://api.carbon.ai for the Authorized JS Origin and Authorized redirect URI. However, for the Authorized redirect URI the domain paths must still be /integrations/google.

  1. Save the credentials. Download the credentials.json file once you save the OAuth Client ID data and share the file with Carbon.

  1. Configure your consent screen in the OAuth Consent Screen. Provide your App name, support email address, and brand logo. Add carbon.ai (or your custom CNAME) to Authorized domain.

  1. Click on Add or Remove Scopes button to add the following scopes: auth/userinfo.profile, auth/userinfo.email, auth/devstorage.read_only.

  2. If you wish to add test users, you can do so. These users will not see the “App is unverified” notification. Other users will see this alert.

  3. Click Publish App to make this app available to your end-users.

Synchronization

We offer a pre-built File Picker UI for GCS through Carbon Connect, since GCS does not provider their own File Picker UI.

You can synchronize buckets, folders, and files GCS using the following steps:

Sync a User’s GCS Account

  • Use the /integrations/items/sync endpoint to synchronize a user’s GCS account.

List All Items from a User’s GCS Account

  • Retrieve a list of all items (buckets and files) from a user’s GCS account by utilizing the /integrations/items/list endpoint.

Specify Specific Files to Sync

  • Employ the /integrations/files/sync endpoint to specify and synchronize specific files.

You can also use the resync_file API endpoint to programmatically resync specific GCS files. To delete GCS files from Carbon, you can use the delete_file endpoint directly.

To sync GCS files on a 24-hour schedule (more frequent schedules available upon request), you can use the /update_users endpoint. This endpoint allows organizations to customize syncing settings according to their requirements, with the option to enable syncing for all data sources using the string ‘ALL’. It’s important to note that each request supports up to 100 customer IDs.

Here’s an example illustrating how to automatically enable syncing for updated GCS content for specified users:

{
    "customer_ids": ["team@carbon.ai", "sam@openai.com"],
    "auto_sync_enabled_sources": ["GCS"]
}