If you’re new to Unstructured, read this note first.Before you can create a source connector, you must first sign in to your Unstructured account:
- If you do not already have an Unstructured account, sign up for free. After you sign up, you are automatically signed in to your new Unstructured Starter account, at https://platform.unstructured.io. To sign up for a Team or Enterprise account instead, contact Unstructured Sales, or learn more.
- If you already have an Unstructured Starter or Team account and are not already signed in, sign in to your account at https://platform.unstructured.io. For an Enterprise account, see your Unstructured account administrator for instructions, or email Unstructured Support at support@unstructured.io.
-
After you sign in to your Unstructured Starter account, click API Keys on the sidebar.
For a Team or Enterprise account, before you click API Keys, make sure you have selected the organizational workspace you want to create an API key for. Each API key works with one and only one organizational workspace. Learn more. -
Click Generate API Key.
-
Follow the on-screen instructions to finish generating the key.
-
Click the Copy icon next to your new key to add the key to your system’s clipboard. If you lose this key, simply return and click the Copy icon again.
- 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 thecredentials.json
key file that you downloaded by following the preceding instructions.-
For macOS or Linux:
-
For Windows:
-
For macOS or Linux:
- 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 thepermissions_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.
-
<name>
(required) - A unique name for this connector. -
<drive-id>
- The ID for the target Google Drive folder or drive. -
<service-account-key>
- The contents of thecredentials.json
key file as a single-line string. -
For
extensions
, set one or more<extension>
values (such aspdf
ordocx
) to process files with only those extensions. The default is to include all extensions.Do not include the leading dot in the file extensions. For example, usepdf
ordocx
instead of.pdf
or.docx
. -
Set
recursive
totrue
to recursively process data from subfolders within the target folder or drive. The default isfalse
if not otherwise specified.