Connect Box to your preprocessing pipeline, and use the Unstructured CLI or Python to batch process all your documents and store structured outputs locally on your filesystem.
The requirements are as follows.
Access to the Developer Console from your Box enterprise account or Box developer account.
A Box Custom App in your Box account, set up to use Server Authentication (with JWT). See Setup with JWT.
The appropriate application scopes and advanced features set up for the Box Custom App, as follows:
Authorization by a Box Admin in your Box account for the Box Custom App. See App Authorization.
Access by your Box account’s source or target folder to your Box Custom App, as follows:
AutomationUser_<your-app-service-id>_<a-random-string@boxdevedition.com
).box://<path/to/folder/in/account>
.The private key configuration JSON file for the Box Custom App, or a string that contains this file’s contents.
To download this file, in the Box Custom App, on the Configuration tab, under Add and Manage Public Keys, click Generate a Public/Private Keypair. Store the downloaded private key configuration JSON file in a secure location.
To ensure maximum compatibility across Unstructured service offerings, you should give the private key configuration JSON file information to Unstructured as
a single-line string that contains the contents of the downloaded private key configuration JSON file (and not the file itself).
To print this single-line string, 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 private key configuration JSON file that you downloaded by following the preceding instructions.
For macOS or Linux:
For Windows:
The Box connector dependencies:
You might also need to install additional dependencies, depending on your needs. Learn more.
The following environment variables:
BOX_APP_CONFIG
- The local path to the downloaded private key configuration JSON file for the Box Custom App,
or a single-line string that contains the contents of this file, represented by --box-app-config
(CLI) or box_app_config
(Python).BOX_REMOTE_URL
- The remote URL to the target folder, represented by --remote-url
(CLI) or remote_url
(Python).
This URL must take the format box://<path/to/folder/in/account>
.Now call the Unstructured CLI or Python. The destination connector can be any of the ones supported. This example uses the local destination connector.
This example sends data to Unstructured for processing by default. To process data locally instead, see the instructions at the end of this page.
For the Unstructured Ingest CLI and the Unstructured Ingest Python library, you can use the --partition-by-api
option (CLI) or partition_by_api
(Python) parameter to specify where files are processed:
To do local file processing, omit --partition-by-api
(CLI) or partition_by_api
(Python), or explicitly specify partition_by_api=False
(Python).
Local file processing does not use an Unstructured API key or API URL, so you can also omit the following, if they appear:
--api-key $UNSTRUCTURED_API_KEY
(CLI) or api_key=os.getenv("UNSTRUCTURED_API_KEY")
(Python)--partition-endpoint $UNSTRUCTURED_API_URL
(CLI) or partition_endpoint=os.getenv("UNSTRUCTURED_API_URL")
(Python)UNSTRUCTURED_API_KEY
and UNSTRUCTURED_API_URL
To send files to the Unstructured Partition Endpoint for processing, specify --partition-by-api
(CLI) or partition_by_api=True
(Python).
Unstructured also requires an Unstructured API key and API URL, by adding the following:
--api-key $UNSTRUCTURED_API_KEY
(CLI) or api_key=os.getenv("UNSTRUCTURED_API_KEY")
(Python)--partition-endpoint $UNSTRUCTURED_API_URL
(CLI) or partition_endpoint=os.getenv("UNSTRUCTURED_API_URL")
(Python)UNSTRUCTURED_API_KEY
and UNSTRUCTURED_API_URL
, representing your API key and API URL, respectively.You must specify the API URL only if you are not using the default API URL for Unstructured Ingest, for example, if you are using a self-hosted instance of the Unstructured API.
The default API URL for Unstructured Ingest is https://api.unstructuredapp.io/general/v0/general
, which is the API URL for the Unstructured Partition Endpoint. However, you should always use the URL that was provided to you when your Unstructured account was created. If you do not have this URL, contact Unstructured Sales at sales@unstructured.io.
If you do not have an API key, get one now.
If the Unstructured API is self-hosted, the process for generating Unstructured API keys, and the Unstructured API URL that you use, are different. For details, contact Unstructured Sales at sales@unstructured.io.
Connect Box to your preprocessing pipeline, and use the Unstructured CLI or Python to batch process all your documents and store structured outputs locally on your filesystem.
The requirements are as follows.
Access to the Developer Console from your Box enterprise account or Box developer account.
A Box Custom App in your Box account, set up to use Server Authentication (with JWT). See Setup with JWT.
The appropriate application scopes and advanced features set up for the Box Custom App, as follows:
Authorization by a Box Admin in your Box account for the Box Custom App. See App Authorization.
Access by your Box account’s source or target folder to your Box Custom App, as follows:
AutomationUser_<your-app-service-id>_<a-random-string@boxdevedition.com
).box://<path/to/folder/in/account>
.The private key configuration JSON file for the Box Custom App, or a string that contains this file’s contents.
To download this file, in the Box Custom App, on the Configuration tab, under Add and Manage Public Keys, click Generate a Public/Private Keypair. Store the downloaded private key configuration JSON file in a secure location.
To ensure maximum compatibility across Unstructured service offerings, you should give the private key configuration JSON file information to Unstructured as
a single-line string that contains the contents of the downloaded private key configuration JSON file (and not the file itself).
To print this single-line string, 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 private key configuration JSON file that you downloaded by following the preceding instructions.
For macOS or Linux:
For Windows:
The Box connector dependencies:
You might also need to install additional dependencies, depending on your needs. Learn more.
The following environment variables:
BOX_APP_CONFIG
- The local path to the downloaded private key configuration JSON file for the Box Custom App,
or a single-line string that contains the contents of this file, represented by --box-app-config
(CLI) or box_app_config
(Python).BOX_REMOTE_URL
- The remote URL to the target folder, represented by --remote-url
(CLI) or remote_url
(Python).
This URL must take the format box://<path/to/folder/in/account>
.Now call the Unstructured CLI or Python. The destination connector can be any of the ones supported. This example uses the local destination connector.
This example sends data to Unstructured for processing by default. To process data locally instead, see the instructions at the end of this page.
For the Unstructured Ingest CLI and the Unstructured Ingest Python library, you can use the --partition-by-api
option (CLI) or partition_by_api
(Python) parameter to specify where files are processed:
To do local file processing, omit --partition-by-api
(CLI) or partition_by_api
(Python), or explicitly specify partition_by_api=False
(Python).
Local file processing does not use an Unstructured API key or API URL, so you can also omit the following, if they appear:
--api-key $UNSTRUCTURED_API_KEY
(CLI) or api_key=os.getenv("UNSTRUCTURED_API_KEY")
(Python)--partition-endpoint $UNSTRUCTURED_API_URL
(CLI) or partition_endpoint=os.getenv("UNSTRUCTURED_API_URL")
(Python)UNSTRUCTURED_API_KEY
and UNSTRUCTURED_API_URL
To send files to the Unstructured Partition Endpoint for processing, specify --partition-by-api
(CLI) or partition_by_api=True
(Python).
Unstructured also requires an Unstructured API key and API URL, by adding the following:
--api-key $UNSTRUCTURED_API_KEY
(CLI) or api_key=os.getenv("UNSTRUCTURED_API_KEY")
(Python)--partition-endpoint $UNSTRUCTURED_API_URL
(CLI) or partition_endpoint=os.getenv("UNSTRUCTURED_API_URL")
(Python)UNSTRUCTURED_API_KEY
and UNSTRUCTURED_API_URL
, representing your API key and API URL, respectively.You must specify the API URL only if you are not using the default API URL for Unstructured Ingest, for example, if you are using a self-hosted instance of the Unstructured API.
The default API URL for Unstructured Ingest is https://api.unstructuredapp.io/general/v0/general
, which is the API URL for the Unstructured Partition Endpoint. However, you should always use the URL that was provided to you when your Unstructured account was created. If you do not have this URL, contact Unstructured Sales at sales@unstructured.io.
If you do not have an API key, get one now.
If the Unstructured API is self-hosted, the process for generating Unstructured API keys, and the Unstructured API URL that you use, are different. For details, contact Unstructured Sales at sales@unstructured.io.