Ingest your files into Unstructured from Google Drive.

The requirements are as follows.

  1. A Google Cloud service account and its related credentials.json key file or its contents in JSON format. Learn how.

  2. To ensure maximum compatibility across Unstructured service offerings, you should give the service account key information to Unstructured as a single-line string that contains the contents of the downloaded service account key file (and not the service account key file itself). To print this single-line string without line breaks, suitable for copying, you can run one of the following commands from your Terminal or Command Prompt. In this command, replace <path-to-downloaded-key-file> with the path to the credentials.json key file that you downloaded by following the preceding instructions.

    • For macOS or Linux:

      tr -d '\n' < <path-to-downloaded-key-file>
      
    • For Windows:

      (Get-Content -Path "<path-to-downloaded-key-file>" -Raw).Replace("`r`n", "").Replace("`n", "")
      
  3. Give the service account’s email address access to the Google Drive folder. Learn more.

  4. Note the folder ID. This is a part of the URL for your Google Drive folder represented in the following URL as {folder_id}: https://drive.google.com/drive/folders/{folder-id}.

To create or change a Google Drive source connector, see the following examples.

Replace the preceding placeholders as follows:

  • <name> (required) - A unique name for this connector.
  • <drive-id> - The ID for the target Google Drive folder.
  • <service-account-key> - The contents of the credentials.json key file as a single-line string.
  • For extensions, set one or more <extension> values (such as .pdf or .docx) to process files with only those extensions. The default is to include all extensions.
  • Set recursive to true to recursively process data from subfolders within the target folder. The default is false if not otherwise specified.

To change a connector, replace <connector-id> with the source connector’s unique ID. To get this ID, see List source connectors.