If you’re new to Unstructured, read this note first.

Before you can create a source connector, you must first sign up for Unstructured. After you sign up, the Unstructured user interface (UI) appears, which you use to create the source connector.

After you create the source connector, add it along with a destination connector to a workflow. Then run the worklow as a job. To learn how, try out the hands-on UI quickstart or watch the 4-minute video tutorial.

You can also create source connectors with the Unstructured API. Learn how.

If you need help, reach out to the community on Slack, or contact us directly.

You are now ready to start creating a source connector! Keep reading to learn how.

Ingest your files into Unstructured from Google Drive.

The requirements are as follows.

  • A Google Cloud account.

  • The Google Drive API enabled in the account. Learn how.

  • Within the account, a Google Cloud service account and its related credentials.json key file or its contents in JSON format. Create a service account. Create credentials for a service account.

    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", "")
      
  • A Google Drive shared folder or shared drive.

  • Give the service account access to the shared folder or shared drive. To do this, share the folder or drive with the service account’s email address. Learn how. Learn more.

  • Get the shared folder’s ID or shared drive’s ID. This is a part of the URL for your Google Drive shared folder or shared drive, represented in the following URL as {folder_id}: https://drive.google.com/drive/folders/{folder-id}.

Document permissions metadata

The source connector outputs any permissions information that it can find in the source location about the processed source documents and associates that information with each corresponding element that is generated. This permissions information is output into the permissions_data field, which is within the data_source field under the element’s metadata field. This information lists the users or groups, if any, that have permissions to read, update, or delete the element’s associated source document.

The following example shows what the output looks like. Ellipses indicate content that has been omitted from this example for brevity.

[
    {
        "...": "...",
        "metadata": {
            "...": "...",
            "data_source": {
                "...": "...",
                "permissions_data": [
                    {
                        "read": {
                            "users": [
                                "11111111111111111111"
                            ],
                            "groups": [
                                "22222222222222222222",
                                "33333333333333333333"
                            ]
                        }
                    },
                    {
                        "update": {
                            "users": [
                                "44444444444444444444",
                                "55555555555555555555"
                            ],
                            "groups": [
                                "66666666666666666666",
                            ]
                        }
                    },
                    {
                        "delete": {
                            "users": [
                                "77777777777777777777"
                            ],
                            "groups": [
                                "88888888888888888888"
                            ]
                        }
                    }
                ],
                "...": "..."
            }
        }
    }
]

To look up information about a particular Google Cloud user, use the user’s ID along with the Admin SDK API or the People API for Google Cloud.

To look up information about a particular Google Cloud group, use the group’s ID along with the Admin SDK API or the Cloud Identity API for Google Cloud.

To create the source connector:

  1. On the sidebar, click Connectors.
  2. Click Sources.
  3. Cick New or Create Connector.
  4. Give the connector some unique Name.
  5. In the Provider area, click Google Drive.
  6. Click Continue.
  7. Follow the on-screen instructions to fill in the fields as described later on this page.
  8. Click Save and Test.

Fill in the following fields:

  • Name (required): A unique name for this connector.

  • Drive ID (required): The target folder’s or drive’s ID.

  • Extensions: A comma-separated list of any file extensions to be included in the ingestion process (such as jpg,pdf), if filtering is needed. The default is to include all files, if not otherwise specified.

    Do not include the leading dot in the file extensions. For example, use jpg or pdf instead of .jpg or .pdf.

  • Recursive: Check this box to also access files from all subfolders within the folder or drive.

  • Account Key (required): The contents of the credentials.json key file for the target service account. These contents must be expressed as a single-line string without line breaks.