curl --request GET \
--url "${UNSTRUCTURED_API_URL}/api/v1/jobs/b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e/download?file_id=output-001.json" \
--header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
--output output-001.json
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import DownloadJobOutputRequest
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = client.jobs.download_job_output(
request=DownloadJobOutputRequest(
job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
file_id="output-001.json"
)
)
print(response)
import asyncio
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import DownloadJobOutputRequest
async def download_job_output():
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = await client.jobs.download_job_output_async(
request=DownloadJobOutputRequest(
job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
file_id="output-001.json"
)
)
print(response)
asyncio.run(download_job_output())
<binary file content>
Job
Download job output
Download the output of a job from a workflow.
GET
/
api
/
v1
/
jobs
/
{job_id}
/
download
curl --request GET \
--url "${UNSTRUCTURED_API_URL}/api/v1/jobs/b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e/download?file_id=output-001.json" \
--header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
--output output-001.json
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import DownloadJobOutputRequest
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = client.jobs.download_job_output(
request=DownloadJobOutputRequest(
job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
file_id="output-001.json"
)
)
print(response)
import asyncio
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import DownloadJobOutputRequest
async def download_job_output():
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = await client.jobs.download_job_output_async(
request=DownloadJobOutputRequest(
job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
file_id="output-001.json"
)
)
print(response)
asyncio.run(download_job_output())
<binary file content>
This applies only to jobs that use a workflow with a local source and a local destination.
- Do not specify a node_id argument. The last workflow node will be used by default.
- Use the get job endpoint to get the job’s details. The file’s Unstructured ID will be in the response’s
input_file_idsarray.
- Use the get job endpoint to get the job’s details:
- The file’s ID will be in the
file_idfield in the response’soutput_node_filesarray - The node’s ID will be in the
node_idfield in the response’soutput_node_filesarray
- The file’s ID will be in the
Path parameters
Query parameters
curl --request GET \
--url "${UNSTRUCTURED_API_URL}/api/v1/jobs/b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e/download?file_id=output-001.json" \
--header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}" \
--output output-001.json
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import DownloadJobOutputRequest
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = client.jobs.download_job_output(
request=DownloadJobOutputRequest(
job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
file_id="output-001.json"
)
)
print(response)
import asyncio
import os
from unstructured_client import UnstructuredClient
from unstructured_client.models.operations import DownloadJobOutputRequest
async def download_job_output():
client = UnstructuredClient(
api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
server_url=os.getenv("UNSTRUCTURED_API_URL"),
)
response = await client.jobs.download_job_output_async(
request=DownloadJobOutputRequest(
job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
file_id="output-001.json"
)
)
print(response)
asyncio.run(download_job_output())
<binary file content>
Was this page helpful?

