Zapier
Zapier hands files to the next step as a URL, so the easiest way to send one to DocSlice is a short Code by Zapier step that downloads the file and uploads it.
Convert a file with Code by Zapier (Python)
Add a Code by Zapier step, choose Run Python, and map two input values: file_url (the file from the previous step) and api_key (stored in the step input, not in the code):
import requests
source = requests.get(input_data["file_url"], timeout=60)
source.raise_for_status()
response = requests.post(
"https://api.docslice.app/v1/convert",
headers={"Authorization": "Bearer " + input_data["api_key"]},
files={"file": ("document.pdf", source.content)},
data={"format": "json"},
timeout=120,
)
response.raise_for_status()
output = {"result": response.json()}
The next steps can use the fields under result (data, document, …). Change the file name to match the real type, and add a schema entry to data (a JSON string) to extract only some fields; see Schema extraction.
Without code: Webhooks by Zapier
The Webhooks by Zapier action can send a custom request: method POST, URL https://api.docslice.app/v1/convert, the header Authorization: Bearer <your API key>, and the fields file and format. File upload from a URL is limited in this action, so use it when the file is already available to Zapier as a file and fall back to the Code step otherwise.
Long documents
For long documents use mode=async with a webhook_url pointing to a Webhooks by Zapier → Catch Hook trigger: DocSlice calls the hook when the job ends with a document.completed event (see Webhooks). Delivery is attempted once, so keep a fallback that reads the job with GET /v1/jobs/{job_id}.