Skip to content

Commit 161191b

Browse files
authored
API: Local source/destination connectors - how-to for multiple files, add connector overview pages (#540)
1 parent d6d65d3 commit 161191b

File tree

6 files changed

+52
-3
lines changed

6 files changed

+52
-3
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Local
3+
---
4+
5+
Send processed data from Unstructured to local storage.
6+
7+
This local destination connector is supported only for REST API clients such as `curl` and Postman. It is currently not supported by the Unstructured user interface (UI) or the Unstructured Python SDK.
8+
9+
The local destination connector works only with the [local source connector](/api-reference/workflow/sources/local). You cannot use the local destination connector with any other source connector.
10+
11+
For details, see the following:
12+
13+
1. [Create a workflow](/api-reference/workflow/workflows#create-a-workflow) that uses a local destination and local source.
14+
2. [Run a workflow as a job](/api-reference/workflow/overview#run-a-workflow) that uses a local destination and local source.
15+
3. [Download a processed local file from the workflow's completed job run](/api-reference/workflow/overview#download-a-processed-local-file-from-a-job).

api-reference/workflow/destinations/overview.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ For the list of specific settings, see:
3131
- [Elasticsearch](/api-reference/workflow/destinations/elasticsearch) (`ELASTICSEARCH` for the Python SDK or `elasticsearch` for `curl` or Postman)
3232
- [Google Cloud Storage](/api-reference/workflow/destinations/google-cloud) (`GCS` for the Python SDK or `gcs` for `curl` or Postman)
3333
- [Kafka](/api-reference/workflow/destinations/kafka) (`KAFKA_CLOUD` for the Python SDK or `kafka-cloud` for `curl` or Postman)
34+
- [Local](/api-reference/workflow/destinations/local) (Supported only for `curl` or Postman)
3435
- [Milvus](/api-reference/workflow/destinations/milvus) (`MILVUS` for the Python SDK or `milvus` for `curl` or Postman)
3536
- [MongoDB](/api-reference/workflow/destinations/mongodb) (`MONGODB` for the Python SDK or `mongodb` for `curl` or Postman)
3637
- [MotherDuck](/api-reference/workflow/destinations/motherduck) (`MOTHERDUCK` for the Python SDK or `motherduck` for `curl` or Postman)

api-reference/workflow/overview.mdx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,15 +1760,18 @@ the `POST` method to call the `/workflows/<workflow-id>/run` endpoint (for `curl
17601760
- `<filename.extension>` with the filename of the local file to upload.
17611761
- `<local-file-media-type>` with the local file's media type. For a list of available media types, such as `application/pdf`, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml).
17621762

1763+
To upload multiple files, add additional `--form` entries, one per file.
1764+
17631765
```bash
17641766
curl --request 'POST' --location \
17651767
"$UNSTRUCTURED_API_URL/workflows/<workflow-id>/run" \
17661768
--header 'accept: application/json' \
17671769
--header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \
1768-
--form "input_files=@</full/path/to/local/filename.extension>" \
1769-
--form "filename=<filename.extension>" \
1770-
--form "type=<local-file-media-type>" \
1770+
--form "input_files=@</full/path/to/local/filename.extension>;filename=<filename.extension>;type=<local-file-media-type>" \
1771+
--form "input_files=@</full/path/to/local/filename.extension>;filename=<filename.extension>;type=<local-file-media-type>" # For each additional file to be uploaded.
17711772
```
1773+
1774+
To access the processed files' data, [download a processed local file](#download-a-processed-local-file-from-a-job) from the workflow's job run.
17721775
</Accordion>
17731776
<Accordion title="Postman (remote source and remote destination)">
17741777
1. In the method drop-down list, select **POST**.
@@ -1810,12 +1813,24 @@ the `POST` method to call the `/workflows/<workflow-id>/run` endpoint (for `curl
18101813
4. On the **Body** tab, select **form-data**, and specify the settings for the workflow run:
18111814

18121815
- **Key**: `input_files`, **File**, **Value**: Click the **Value** box, then click **New file from local machine**, and select the file to upload.
1816+
1817+
To upload multiple files, add additional `input_files` entries after this one, one entry per additional file to upload.
1818+
18131819
- **Key**: `filename`, **Text**, **Value**: Type the name of the file that you just uploaded.
1820+
1821+
To upload multiple files, add additional `filename` entries after this one, one entry per additional file to upload. Make sure the order of these
1822+
`filename` entries matches the order of the `input_files` entries, respectively.
1823+
18141824
- **Key**: `type`, **Text**, **Value**: `<local-file-media-type>`
18151825

1826+
To upload multiple files, add additional `type` entries after this one, one entry per additional file to upload. Make sure the order of these
1827+
`type` entries matches the order of the `input_files` entries, respectively.
1828+
18161829
For a list of available media types, such as `application/pdf`, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml).
18171830

18181831
5. Click **Send**.
1832+
1833+
To access the processed files' data, [download a processed local file](#download-a-processed-local-file-from-a-job) from the workflow's job run.
18191834
</Accordion>
18201835
</AccordionGroup>
18211836

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Local
3+
---
4+
5+
Ingest your files into Unstructured from local storage.
6+
7+
This local source connector is supported only for REST API clients such as `curl` and Postman. It is currently not supported by the Unstructured user interface (UI) or the Unstructured Python SDK.
8+
9+
The local source connector works only with the [local destination connector](/api-reference/workflow/destinations/local). You cannot use the local source connector with any other destination connector.
10+
11+
For details, see the following:
12+
13+
1. [Create a workflow](/api-reference/workflow/workflows#create-a-workflow) that uses a local source and local destination.
14+
2. [Run a workflow as a job](/api-reference/workflow/overview#run-a-workflow) that uses a local source and local destination.
15+
3. [Download a processed local file from the workflow's completed job run](/api-reference/workflow/overview#download-a-processed-local-file-from-a-job).

api-reference/workflow/sources/overview.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ For the list of specific settings, see:
3232
- [Google Cloud Storage](/api-reference/workflow/sources/google-cloud) (`GCS` for the Python SDK or `gcs` for `curl` and Postman)
3333
- [Google Drive](/api-reference/workflow/sources/google-drive) (`GOOGLE_DRIVE` for the Python SDK or `google_drive` for `curl` and Postman)
3434
- [Kafka](/api-reference/workflow/sources/kafka) (`KAFKA_CLOUD` for the Python SDK or `kafka-cloud` for `curl` and Postman)
35+
- [Local](/api-reference/workflow/sources/local) (Supported only for `curl` and Postman)
3536
- [MongoDB](/api-reference/workflow/sources/mongodb) (`MONGODB` for the Python SDK or `mongodb` for `curl` and Postman)
3637
- [OneDrive](/api-reference/workflow/sources/onedrive) (`ONEDRIVE` for the Python SDK or `onedrive` for `curl` and Postman)
3738
- [Outlook](/api-reference/workflow/sources/outlook) (`OUTLOOK` for the Python SDK or `outlook` for `curl` and Postman)

mint.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@
281281
"api-reference/workflow/sources/google-cloud",
282282
"api-reference/workflow/sources/google-drive",
283283
"api-reference/workflow/sources/kafka",
284+
"api-reference/workflow/sources/local",
284285
"api-reference/workflow/sources/mongodb",
285286
"api-reference/workflow/sources/onedrive",
286287
"api-reference/workflow/sources/outlook",
@@ -304,6 +305,7 @@
304305
"api-reference/workflow/destinations/elasticsearch",
305306
"api-reference/workflow/destinations/google-cloud",
306307
"api-reference/workflow/destinations/kafka",
308+
"api-reference/workflow/destinations/local",
307309
"api-reference/workflow/destinations/milvus",
308310
"api-reference/workflow/destinations/mongodb",
309311
"api-reference/workflow/destinations/motherduck",

0 commit comments

Comments
 (0)