Processing API
The Processing API provides endpoints for retrieving and managing processed documents. These endpoints allow you to access the results of completed jobs and retrieve user documents using API key authentication.
API Endpoints
Get Processing Document
/processing/ID/document Retrieve a specific processed document by its ID.
curl -X GET https://api.shrinked.com/processing/doc123456/document \ -H "x-api-key: YOUR_API_KEY"{ "id": "doc123456", "title": "Processed Document Title", "content": "Full processed document content...", "metadata": { "source": "https://example.com/media/file.mp4", "processingTime": 125, "wordCount": 2500, "language": "en" }, "sections": [ { "id": "section1", "title": "Introduction", "content": "Section content..." }, { "id": "section2", "title": "Main Topics", "content": "Section content..." }, { "id": "section3", "title": "Conclusion", "content": "Section content..." } ], "createdAt": "2023-05-10T16:00:00Z"}Get User Documents
/processing/user/USER_ID/documents Retrieve all processed documents for a specific user.
curl -X GET https://api.shrinked.com/processing/user/user123456/documents?limit=20&sortBy=createdAt&sortOrder=desc \ -H "x-api-key: YOUR_API_KEY"{ "documents": [ { "id": "doc123456", "title": "Processed Document 1", "summary": "Brief summary of the document...", "createdAt": "2023-05-10T16:00:00Z" }, { "id": "doc789012", "title": "Processed Document 2", "summary": "Brief summary of the document...", "createdAt": "2023-05-05T14:30:00Z" } ], "total": 45, "limit": 20, "offset": 0}Document Structure
Processed documents typically contain the following components:
Title
Document title automatically extracted from content
Content
Full processed text content
Metadata
Processing metadata (source, time, count, language)
Sections
Organized document sections with titles
Summary
Concise summary of the document
Keywords
Key topics and entities detected in the content
The structure of the document may vary depending on the processing scenario used when creating the job.
Working with Large Documents
Use Pagination
When retrieving user documents, use pagination parameters (limit and offset) to manage large result sets.
Request Specific Sections
For particularly large documents, retrieve specific sections rather than the entire document to improve performance.
Use the Summary Endpoint
Start with the summary endpoint to get a quick overview before requesting the full document.
Export to PDF
Use the PDF API to export documents in portable formats for offline viewing and distribution.
Error Handling
The Processing API uses standard HTTP status codes:
| Status Code | Description |
|---|---|
| 200 | Request successful |
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (invalid credentials) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Document not found |
| 500 | Server error |
Error responses include a descriptive message to help troubleshoot issues:
{ "error": { "code": "DOCUMENT_NOT_FOUND", "message": "The requested document could not be found" }}Common Error Codes
| Error Code | Description |
|---|---|
DOCUMENT_NOT_FOUND | The requested document does not exist |
SECTION_NOT_FOUND | The requested section does not exist |
INVALID_DOCUMENT_ID | The document ID format is invalid |
ACCESS_DENIED | You don’t have permission to access this document |
PROCESSING_INCOMPLETE | The document is still being processed |