diff --git a/api-reference/workflow/jobs.mdx b/api-reference/workflow/jobs.mdx index 01ace1c2..3d2f60e9 100644 --- a/api-reference/workflow/jobs.mdx +++ b/api-reference/workflow/jobs.mdx @@ -12,7 +12,9 @@ To use the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) to the `GET` method to call the `/jobs//details` endpoint (for `curl` or Postman). [Learn more](/api-reference/workflow/overview#get-processing-details-for-a-job). - To get the list of any failed files for a job and why those files failed, use the `UnstructuredClient` object's `jobs.get_failed_files` function (for the Python SDK) or the `GET` method to call the `/jobs//failed-files` endpoint (for `curl` or Postman). [Learn more](/api-reference/workflow/overview#get-failed-file-details-for-a-job). +- To run a workflow that takes one or more local files only as input, and the workflow exists only for the duration of + that job's run (known as an _on-demand job_), use the `POST` method to call the `/jobs/` endpoint for `curl` or Postman. [Learn more](/api-reference/workflow/overview#run-an-on-demand-job). - A job is created automatically whenever a workflow runs on a schedule; see [Create a workflow](/api-reference/workflow/workflows#create-a-workflow). - A job is also created whenever you run a workflow manually; see [Run a workflow](/api-reference/workflow/overview#run-a-workflow). + A job is also created automatically whenever you run a workflow manually; see [Run a workflow](/api-reference/workflow/overview#run-a-workflow). - To cancel a running job, use the `UnstructuredClient` object's `jobs.cancel_job` function (for the Python SDK) or the `POST` method to call the `/jobs//cancel` endpoint (for `curl` or Postman). [Learn more](/api-reference/workflow/overview#cancel-a-job). \ No newline at end of file diff --git a/api-reference/workflow/overview.mdx b/api-reference/workflow/overview.mdx index 25e70dec..84cad10f 100644 --- a/api-reference/workflow/overview.mdx +++ b/api-reference/workflow/overview.mdx @@ -201,8 +201,17 @@ Unstructured offers a [Postman collection](https://learning.postman.com/docs/col 4. In the **Paste cURL, Raw text or URL** box, enter the following URL, and then press `Enter`: - ``` + For all workflow operations: + + ```text https://raw.githubusercontent.com/Unstructured-IO/docs/main/examplecode/codesamples/api/Unstructured-REST-API-Workflow-Endpoint.postman_collection.json + ``` + + For [on-demand job](#run-an-on-demand-job) related operations only: + + ```text + https://raw.githubusercontent.com/Unstructured-IO/docs/main/examplecode/codesamples/api/Unstructured-REST-API-On-Demand-Jobs.postman_collection.json + ``` 5. On the sidebar, click **Collections**. 6. Expand **Unstructured REST API - Workflow Endpoint**. @@ -1689,6 +1698,12 @@ the `GET` method to call the `/workflows/` endpoint (for `curl` or To create a workflow, use the `UnstructuredClient` object's `workflows.create_workflow` function (for the Python SDK) or the `POST` method to call the `/workflows` endpoint (for `curl` or Postman). + + The following instructions create a workflow that exists until it is explicitly deleted. + To create a workflow that exists only for the duration of + that workflow's job run, and that job run's temporary workflow takes one or more local files only as input, see [Run an on-demand job](#run-an-on-demand-job). + + In the `CreateWorkflow` object (for the Python SDK) or the request body (for `curl` or Postman), specify the settings for the workflow. For the specific settings to include, see @@ -1835,6 +1850,12 @@ To run a workflow manually, use the `UnstructuredClient` object's `workflows.run the `POST` method to call the `/workflows//run` endpoint (for `curl` or Postman), replacing `` with the workflow's unique ID. To get this ID, see [List workflows](#list-workflows). + + The following instructions run a workflow that was already created at some point in the past and still exists. + To run a workflow that exists only for the duration of a single job run, and the job's temporary workflow + takes one or more local files only as input (known as an _on-demand job_), see [Run an on-demand job](#run-an-on-demand-job). + + ```python @@ -2024,17 +2045,7 @@ the `POST` method to call the `/workflows//run` endpoint (for `curl To upload multiple files, add additional `input_files` entries after this one, one entry per additional file to upload. - - **Key**: `filename`, **Text**, **Value**: Type the name of the file that you just uploaded. - - To upload multiple files, add additional `filename` entries after this one, one entry per additional file to upload. Make sure the order of these - `filename` entries matches the order of the `input_files` entries, respectively. - - - **Key**: `type`, **Text**, **Value**: `` - - To upload multiple files, add additional `type` entries after this one, one entry per additional file to upload. Make sure the order of these - `type` entries matches the order of the `input_files` entries, respectively. - - For a list of available media types, such as `application/pdf`, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). + For a list of available media types, such as `application/pdf`, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). 5. Click **Send**. @@ -2270,15 +2281,87 @@ the `DELETE` method to call the `/workflows/` endpoint (for `curl` ## Jobs -You can [list](#list-jobs), +You can [run on demand](#run-an-on-demand-job), [list](#list-jobs), [get](#get-a-job), and [cancel](#cancel-a-job) jobs. A job is created automatically whenever a workflow runs on a schedule; see [Create a workflow](#create-a-workflow). -A job is also created whenever you run a workflow; see [Run a workflow](#run-a-workflow). +A job is also created automatically whenever you run a workflow; see [Run a workflow](#run-a-workflow). For general information, see [Jobs](/ui/jobs). +### Run an on-demand job + +To run a job whose workflow takes one or more local files only as input, and the job's temporary workflow exists only for the duration of +that job's run (known as an _on-demand job_), use the `POST` method to call the `/jobs/` endpoint for `curl` or Postman. + + + To run a workflow that was already created at some point in the past and still exists, see [Run a workflow](#run-a-workflow). + + + + + In the following command, replace: + + - `` with the full path to the local file to upload. + - `` with the filename of the local file to upload. + - `` 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). + - To upload multiple files, add additional `--form` entries, one per file. + - For additional replacements, see the end of this section. + + ```bash + curl --request 'POST' --location \ + "$UNSTRUCTURED_API_URL/jobs/" \ + --header 'accept: application/json' \ + --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \ + --form "request_data={\"job_type\":\"\",\"template_id\":\"\",\"job_nodes\":[]}" \ + --form "input_files=@;filename=;type=" \ + --form "input_files=@;filename=;type=" # For each additional file to be uploaded. + + ``` + + To access the processed files' data, [download a processed local file](#download-a-processed-local-file-from-a-job) from the job's run. + + + 1. In the method drop-down list, select **POST**. + 2. In the address box, enter the following URL: + + ```text + {{UNSTRUCTURED_API_URL}}/jobs/ + ``` + + 3. On the **Headers** tab, enter the following headers: + + - **Key**: `unstructured-api-key`, **Value**: `{{UNSTRUCTURED_API_KEY}}` + - **Key**: `accept`, **Value**: `application/json` + + 4. On the **Body** tab, select **form-data**, and specify the settings for the on-demand job, as follows: + + - **Key**: `input_files`, **File**, **Value**: Click the **Value** box, then click **New file from local machine**, and select the file to upload. + + To upload multiple files, add additional `input_files` entries after this one, one entry per additional file to upload. + + - **Key**: `request_data`, **Text**, **Value**: Specify the settings for the on-demand job, as follows: + + ```json + {"job_type":"","template_id":"","job_nodes":[]} + ``` + 5. Click **Send**. + + To access the processed files' data, [download a processed local file](#download-a-processed-local-file-from-a-job) from the job's run. + + + +Replace the preceding placeholders as follows: + +- `` - The type of job to run. Available values include: + + - `template` - This job's workflow nodes are specified by a workflow template. + - `ephemeral` - This job's workflow nodes are manually specified. + +- `` - If `` is set to `template`, the unique ID of the workflow template to use for this job's workflow nodes. For instructions, see [List workflow templates](#list-workflow-templates) and [Get a workflow template](#get-a-workflow-template). +- `` - If `` is set to `ephemeral`, the settings for the job's workflow nodes. For instructions, see [Custom workflow DAG nodes](/api-reference/workflow/workflows#custom-workflow-dag-nodes). + ### List jobs To list jobs, use the `UnstructuredClient` object's `jobs.list_jobs` function (for the Python SDK) or diff --git a/api-reference/workflow/workflows.mdx b/api-reference/workflow/workflows.mdx index 1949c523..1e0018aa 100644 --- a/api-reference/workflow/workflows.mdx +++ b/api-reference/workflow/workflows.mdx @@ -16,6 +16,10 @@ To use the [Unstructured Workflow Endpoint](/api-reference/workflow/overview) to the `PUT` method to call the `/workflows/` endpoint (for `curl` or Postman). [Learn more](#update-a-workflow). - To delete a workflow, use the `UnstructuredClient` object's `workflows.delete_workflow` function (for the Python SDK) or the `DELETE` method to call the `/workflows/` endpoint (for `curl` or Postman). [Learn more](/api-reference/workflow/overview#delete-a-workflow). +- To get a list of available workflow templates, use the `GET` method to call the `/templates` endpoint (for `curl` or Postman). + [Learn more](/api-reference/workflow/overview#list-workflow-templates). +- To get information about a workflow template, use the `GET` method to call the `/templates/` endpoint (for `curl` or Postman). + [Learn more](/api-reference/workflow/overview#get-a-workflow-template). The following examples assume that you have already met the [requirements](/api-reference/workflow/overview#requirements) and understand the [basics](/api-reference/workflow/overview#basics) of working with the Unstructured Workflow Endpoint. @@ -72,7 +76,8 @@ specify the settings for the workflow, as follows: name="", source_id="", destination_id="", - workflow_type=WorkflowType., + workflow_type=WorkflowType., + template_id="", workflow_nodes=[ workflow_node, another_workflow_node @@ -317,7 +322,8 @@ specify the settings for the workflow, as follows: name="", source_id="", destination_id="", - workflow_type=WorkflowType., + workflow_type=WorkflowType., + template_id="", workflow_nodes=[ workflow_node, another_workflow_node @@ -540,7 +546,8 @@ specify the settings for the workflow, as follows: "name": "", "source_id": "", "destination_id": "", - "workflow_type": "", + "workflow_type": "", + "template_id": "", "workflow_nodes": [ { "name": "", @@ -579,6 +586,7 @@ specify the settings for the workflow, as follows: '{ "name": "", "workflow_type": "custom", + "template_id": "", "workflow_nodes": [ { "name": "", @@ -617,6 +625,7 @@ specify the settings for the workflow, as follows: "name": "", "destination_id": "", "workflow_type": "custom", + "template_id": "", "workflow_nodes": [ { "name": "", @@ -653,7 +662,8 @@ specify the settings for the workflow, as follows: "name": "", "source_id": "", "destination_id": "", - "workflow_type": "", + "workflow_type": "", + "template_id": "", "workflow_nodes": [ { "name": "", @@ -703,6 +713,7 @@ specify the settings for the workflow, as follows: { "name": "", "workflow_type": "custom", + "template_id": "", "workflow_nodes": [ { "name": "", @@ -751,6 +762,7 @@ specify the settings for the workflow, as follows: { "name": "", "workflow_type": "custom", + "template_id": "", "workflow_nodes": [ { "name": "", @@ -781,10 +793,11 @@ Replace the preceding placeholders as follows: - `` (_required_) - The ID of the target destination connector. To get the ID, use the `UnstructuredClient` object's `destinations.list_destinations` function (for the Python SDK) or the `GET` method to call the `/destinations` endpoint (for `curl` or Postman). [Learn more](/api-reference/workflow/overview#list-destination-connectors). -- `` (for the Python SDK) or `` (for `curl` or Postman) (_required_) - The workflow type. Available values include `CUSTOM` (for the Python SDK) and `custom` (for `curl` or Postman). - - If `` is set to `CUSTOM` (for the Python SDK), or if `` is set to `custom` (for `curl` or Postman), you must add a `workflow_nodes` array. For instructions, see [Custom workflow DAG nodes](#custom-workflow-dag-nodes). +- `` (_required_) - The workflow type. Available values include: + - `CUSTOM` (for the Python SDK) and `custom` (for `curl` or Postman) - This workflow's nodes are manually specified in the `workflow_nodes` array. For instructions, see [Custom workflow DAG nodes](#custom-workflow-dag-nodes). + - `TEMPLATE` (for the Python SDK) and `template` (for `curl` or Postman) - This workflow's nodes are specified by a workflow template. In this case, you would not add a `workflow_nodes` array. Instead, you must specify the workflowtemplate's unique ID in the `template_id` field. For instructions, see [List workflow templates](#list-workflow-templates) and [Get a workflow template](#get-a-workflow-template). + The previously-available workflow optimization types `ADVANCED`, `BASIC`, and `PLATINUM` (for the Python SDK) and `advanced`, `basic`, and `platinum` (for `curl` or Postman) are non-operational and planned to be fully removed in a future release. @@ -1942,4 +1955,66 @@ Allowed values for `subtype` and `model_name` include: - `"model_name": "voyage-finance-2"` - `"model_name": "voyage-law-2"` - `"model_name": "voyage-code-2"` - - `"model_name": "voyage-multimodal-3"` \ No newline at end of file + - `"model_name": "voyage-multimodal-3"` + +## List workflow templates + +To list workflow templates, use the `GET` method to call the `/templates` endpoint for `curl` or Postman. + + + + ```bash + curl --request 'POST' --location \ + "$UNSTRUCTURED_API_URL/templates" \ + --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \ + --header 'accept: application/json' + ``` + + + 1. In the method drop-down list, select **GET**. + 2. In the address box, enter the following URL: + + ```text + {{UNSTRUCTURED_API_URL}}/templates + ``` + + 3. On the **Headers** tab, enter the following headers: + + - **Key**: `unstructured-api-key`, **Value**: `{{UNSTRUCTURED_API_KEY}}` + - **Key**: `accept`, **Value**: `application/json` + + 4. Click **Send**. + + + +## Get a workflow template + +To get information about a workflow template, use the `GET` method to call the +`/templates/` endpoint for `curl` or Postman, replacing `` with the +workflow template's unique ID. To get this ID, see [List workflow templates](#list-workflow-templates). + + + + ```bash + curl --request 'GET' --location \ + "$UNSTRUCTURED_API_URL/templates/" \ + --header "unstructured-api-key: $UNSTRUCTURED_API_KEY" \ + --header 'accept: application/json' + ``` + + + 1. In the method drop-down list, select **GET**. + 2. In the address box, enter the following URL: + + ```text + {{UNSTRUCTURED_API_URL}}/templates/ + ``` + + 3. On the **Headers** tab, enter the following headers: + + - **Key**: `unstructured-api-key`, **Value**: `{{UNSTRUCTURED_API_KEY}}` + - **Key**: `accept`, **Value**: `application/json` + + 4. Click **Send**. + + \ No newline at end of file diff --git a/examplecode/codesamples/api/Unstructured-REST-API-On-Demand-Jobs.postman_collection.json b/examplecode/codesamples/api/Unstructured-REST-API-On-Demand-Jobs.postman_collection.json new file mode 100644 index 00000000..dd20ef95 --- /dev/null +++ b/examplecode/codesamples/api/Unstructured-REST-API-On-Demand-Jobs.postman_collection.json @@ -0,0 +1,108 @@ +{ + "info": { + "_postman_id": "600b293c-57b2-4d84-8bcf-e6353f0e7a12", + "name": "Unstructured REST API - On-Demand Jobs", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "38317384" + }, + "item": [ + { + "name": "1. Run an On-Demand Job", + "request": { + "method": "POST", + "header": [ + { + "key": "unstructured-api-key", + "value": "{{UNSTRUCTURED_API_KEY}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "input_files", + "type": "file", + "src": [] + }, + { + "key": "request_data", + "value": "{\"job_type\":\"\",\"template_id\":\"\",\"job_nodes\":[]}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{UNSTRUCTURED_API_URL}}/jobs/", + "host": [ + "{{UNSTRUCTURED_API_URL}}" + ], + "path": [ + "jobs", + "" + ] + } + }, + "response": [] + }, + { + "name": "2. Get On-Demand Job Status", + "request": { + "method": "GET", + "header": [ + { + "key": "unstructured-api-key", + "value": "{{UNSTRUCTURED_API_KEY}}", + "type": "text" + } + ], + "url": { + "raw": "{{UNSTRUCTURED_API_URL}}/jobs/", + "host": [ + "{{UNSTRUCTURED_API_URL}}" + ], + "path": [ + "jobs", + "" + ] + } + }, + "response": [] + }, + { + "name": "3. Download a Processed Local File", + "request": { + "method": "GET", + "header": [ + { + "key": "unstructured-api-key", + "value": "{{UNSTRUCTURED_API_KEY}}", + "type": "text" + } + ], + "url": { + "raw": "{{UNSTRUCTURED_API_URL}}/jobs//download?file_id=&node_id=", + "host": [ + "{{UNSTRUCTURED_API_URL}}" + ], + "path": [ + "jobs", + "", + "download" + ], + "query": [ + { + "key": "file_id", + "value": "" + }, + { + "key": "node_id", + "value": "" + } + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/examplecode/codesamples/api/Unstructured-REST-API-Workflow-Endpoint.postman_collection.json b/examplecode/codesamples/api/Unstructured-REST-API-Workflow-Endpoint.postman_collection.json index 8d5a15b1..11ac958f 100644 --- a/examplecode/codesamples/api/Unstructured-REST-API-Workflow-Endpoint.postman_collection.json +++ b/examplecode/codesamples/api/Unstructured-REST-API-Workflow-Endpoint.postman_collection.json @@ -16,21 +16,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources" ] } @@ -44,21 +39,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources?source_type=", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources?source_type=", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources" ], "query": [ @@ -79,21 +69,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources", "" ] @@ -118,7 +103,7 @@ }, { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -132,16 +117,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources" ] } @@ -165,7 +145,7 @@ }, { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -179,16 +159,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources", "" ] @@ -203,21 +178,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources", "" ] @@ -232,21 +202,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/sources//connection-check", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/sources//connection-check", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "sources", "", "connection-check" @@ -267,21 +232,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations" ] } @@ -295,21 +255,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations?destination_type=", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations?destination_type=", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations" ], "query": [ @@ -331,21 +286,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations", "" ] @@ -370,7 +320,7 @@ }, { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -384,16 +334,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations" ] } @@ -417,7 +362,7 @@ }, { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -431,16 +376,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations", "" ] @@ -455,21 +395,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations", "" ] @@ -484,21 +419,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/destinations//connection-check", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/destinations//connection-check", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "destinations", "", "connection-check" @@ -519,21 +449,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows" ] } @@ -547,21 +472,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows?source_id=", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows?source_id=", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows" ], "query": [ @@ -581,21 +501,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows?destination_id=", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows?destination_id=", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows" ], "query": [ @@ -615,21 +530,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows?status=", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows?status=", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows" ], "query": [ @@ -650,21 +560,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows", "" ] @@ -692,13 +597,13 @@ }, { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n // Specify the settings for the workflow here.\n // See https://docs.unstructured.io/api-reference/workflow/workflows#create-a-workflow\n // For example:\n \"name\": \"\",\n \"source_id\": \"\", // To use a local source, omit \"source_id\".\n \"destination_id\": \"\", // To use a local destination, omit \"destination_id\".\n \"workflow_type\": \"\",\n \"workflow_nodes\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"subtype\": \"\",\n \"settings\": {\n \"\": \"\"\n }\n },\n {\n \"name\": \"\",\n \"type\": \"\",\n \"subtype\": \"\",\n \"settings\": {\n \"\": \"\"\n }\n }\n // And so on for additional workflow DAG nodes.\n ],\n \"schedule\": \"\"\n}\n\n\n\n\n\n\n\n", + "raw": "{\n // Specify the settings for the workflow here.\n // See https://docs.unstructured.io/api-reference/workflow/workflows#create-a-workflow\n // For example:\n \"name\": \"\",\n \"source_id\": \"\", // To use a local source, omit \"source_id\".\n \"destination_id\": \"\", // To use a local destination, omit \"destination_id\".\n \"workflow_type\": \"\", // To use a workflow template: \"template\". To specify nodes manually: \"custom\".\n \"template_id\": \"\", // To specify nodes manually, omit \"template_id\". To use a workflow template, omit \"workflow_nodes\".\n \"workflow_nodes\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"subtype\": \"\",\n \"settings\": {\n \"\": \"\"\n }\n },\n {\n \"name\": \"\",\n \"type\": \"\",\n \"subtype\": \"\",\n \"settings\": {\n \"\": \"\"\n }\n }\n // And so on for additional workflow DAG nodes.\n ],\n \"schedule\": \"\"\n}\n\n\n\n\n\n\n\n", "options": { "raw": { "language": "json" @@ -706,16 +611,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows" ] } @@ -742,7 +642,7 @@ }, { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -756,16 +656,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows", "" ] @@ -783,21 +678,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows", "" ] @@ -815,7 +705,7 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -824,16 +714,11 @@ "formdata": [] }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows//run", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows//run", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows", "", "run" @@ -852,7 +737,7 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -877,22 +762,64 @@ ] }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/workflows//run", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/workflows//run", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "workflows", "", "run" ] }, - "description": "To run the workflow for multiple files, add an additional `input_files`, `filename`, and `type` entry for each additional file.\n\nSee also [https://docs.unstructured.io/api-reference/workflow/overview#run-a-workflow](https://docs.unstructured.io/api-reference/workflow/overview#run-a-workflow)" + "description": "To run the worfklow for multiple files, add an additional `input_files`, `filename`, and `type` entry for each additional file.\n\nSee also [https://docs.unstructured.io/api-reference/workflow/overview#run-a-workflow](https://docs.unstructured.io/api-reference/workflow/overview#run-a-workflow)" + }, + "response": [] + }, + { + "name": "List Workflow Templates", + "request": { + "method": "GET", + "header": [ + { + "key": "unstructured-api-key", + "value": "{{UNSTRUCTURED_API_KEY}}", + "type": "text" + } + ], + "url": { + "raw": "{{UNSTRUCTURED_API_URL}}/templates", + "host": [ + "{{UNSTRUCTURED_API_URL}}" + ], + "path": [ + "templates" + ] + } + }, + "response": [] + }, + { + "name": "Get a Workflow Template", + "request": { + "method": "GET", + "header": [ + { + "key": "unstructured-api-key", + "value": "{{UNSTRUCTURED_API_KEY}}", + "type": "text" + } + ], + "url": { + "raw": "{{UNSTRUCTURED_API_URL}}/templates/", + "host": [ + "{{UNSTRUCTURED_API_URL}}" + ], + "path": [ + "templates", + "" + ] + } }, "response": [] } @@ -908,21 +835,16 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/jobs", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/jobs", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "jobs" ] } @@ -939,7 +861,7 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -953,16 +875,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/jobs/", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/jobs/", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "jobs", "" ] @@ -977,7 +894,7 @@ "header": [ { "key": "unstructured-api-key", - "value": "", + "value": "{{UNSTRUCTURED_API_KEY}}", "type": "text" } ], @@ -991,16 +908,11 @@ } }, "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/jobs//cancel", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/jobs//cancel", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "jobs", "", "cancel" @@ -1029,18 +941,13 @@ } ], "url": { - "raw": "https://platform.unstructuredapp.io/api/v1/jobs//download?file_id=&node_id=", - "protocol": "https", + "raw": "{{UNSTRUCTURED_API_URL}}/jobs/>/download?file_id=&node_id=", "host": [ - "platform", - "unstructuredapp", - "io" + "{{UNSTRUCTURED_API_URL}}" ], "path": [ - "api", - "v1", "jobs", - "", + ">", "download" ], "query": [ @@ -1057,6 +964,50 @@ "description": "To get the values for `file_id` and `node_id`, run the \"GET Get a Job\" request.\n\nSee also [https://docs.unstructured.io/api-reference/workflow/overview#download-a-processed-local-file-from-a-job](https://docs.unstructured.io/api-reference/workflow/overview#download-a-processed-local-file-from-a-job)" }, "response": [] + }, + { + "name": "Run an On-Demand Job - Local Source and Local Destination", + "request": { + "method": "POST", + "header": [ + { + "key": "unstructured-api-key", + "value": "{{UNSTRUCTURED_API_KEY}}", + "type": "text" + }, + { + "key": "accept", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "input_files", + "type": "file", + "src": [] + }, + { + "key": "request_data", + "value": "{\"job_type\":\"\",\"template_id\":\"\",\"job_nodes\":[]}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{UNSTRUCTURED_API_URL}}/jobs/", + "host": [ + "{{UNSTRUCTURED_API_URL}}" + ], + "path": [ + "jobs", + "" + ] + } + }, + "response": [] } ] },