This guide demonstrates how to upload documents to DocFlow using file URLs via REST API.
Compared to direct file upload, URL upload is more suitable for processing remote files or batch processing scenarios.
DocFlow supports uploading documents via file URLs without requiring local file storage. This approach is particularly suitable for:
Processing files on remote servers
Batch processing multiple file URLs
Reducing local storage and network transmission overhead
01 Single File URL Upload
Submit file URL list using application/json format:
curl -X POST \
-H "x-ti-app-id: <your-app-id>" \
-H "x-ti-secret-code: <your-secret-code>" \
-H "Content-Type: application/json" \
-d '{
"urls": ["https://example.com/document.pdf"]
}' \
"https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload?workspace_id=<your-workspace-id>"
02 Batch URL Upload
A single request can upload multiple file URLs, supporting up to 10 files :
curl -X POST \
-H "x-ti-app-id: <your-app-id>" \
-H "x-ti-secret-code: <your-secret-code>" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://example.com/invoice1.pdf",
"https://example.com/invoice2.pdf",
"https://example.com/contract.docx"
]
}' \
"https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload?workspace_id=<your-workspace-id>&batch_number=202412190001"
03 Parameter Description
Required Parameters
Request Body Parameters
urls: File URL list
Type: String array
Limit: Maximum 10 URLs per request
Format: Must be valid URLs starting with http:// or https://
File size: Each file maximum 50MB
Optional Parameters
Can be added in URL query parameters as needed:
category: File category (e.g., invoice)
batch_number: Batch number, auto-generated if not provided
auto_verify_vat: Whether to enable invoice verification, default false
split_flag: Whether to perform file splitting, default false (see File Splitting chapter)
crop_flag: Whether to perform multi-image cropping, default false (see Multi-image Cropping chapter)
target_process: Target processing type, optional classify or extract
04 URL Requirements
Must start with http:// or https://
URL must be publicly accessible (no authentication required)
Server must support HTTP GET requests
File Requirements
File format: Supports all formats listed in File Format Support
File size: Single file not exceeding 50MB
File pages: Multi-page documents not exceeding 1000 pages
Example URLs
# Valid URL examples
https://example.com/document.pdf
https://cdn.example.com/files/invoice.pdf
http://192.168.1.100/shared/contract.docx
# Invalid URL examples
ftp://example.com/file.pdf # FTP protocol not supported
file:///local/path/document.pdf # Local file paths not supported
https://example.com/protected.pdf # URLs requiring authentication
The response format after successful URL upload is the same as regular file upload:
{
"code" : 200 ,
"msg" : "Success" ,
"result" : {
"batch_number" : "202412190001" ,
"files" : [
{
"id" : "1955840505753140508" ,
"name" : "document.pdf" ,
"format" : "pdf"
},
{
"id" : "1955840505753140509" ,
"name" : "invoice.pdf" ,
"format" : "pdf"
}
]
}
}
See all 19 lines
06 Query Processing Results
After upload completion, use the returned batch_number to query processing results:
curl \
-H "x-ti-app-id: <your-app-id>" \
-H "x-ti-secret-code: <your-secret-code>" \
"https://docflow.textin.com/api/app-api/sip/platform/v2/file/fetch?workspace_id=<your-workspace-id>&batch_number=<your-batch-number>"