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/userId/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}Get Document Content By Section
/processing/ID/sections/sectionId Retrieve a specific section of a processed document.
curl -X GET https://api.shrinked.com/processing/doc123456/sections/section1 \ -H "x-api-key: YOUR_API_KEY"{ "id": "section1", "title": "Introduction", "content": "The introduction reveals key themes that will be explored...", "metadata": { "wordCount": 450, "timestamp": { "start": "00:00:15", "end": "00:03:20" } }}Get Document Summary
/processing/ID/summary Retrieve a summary of a processed document.
curl -X GET https://api.shrinked.com/processing/doc123456/summary?length=medium \ -H "x-api-key: YOUR_API_KEY"{ "id": "doc123456", "title": "Quarterly Earnings Call", "summary": "The company reported a strong quarterly performance with revenue growth of 18%, exceeding market expectations. Key highlights include expansion into European markets, launch of a new product line, and improved profit margins. The CEO announced plans for strategic acquisitions in the coming year.", "keyPoints": [ "18% revenue growth", "European market expansion", "New product line launch", "Planned strategic acquisitions" ], "length": "medium"}Get Document Metadata
/processing/ID/metadata Retrieve metadata about a processed document.
curl -X GET https://api.shrinked.com/processing/doc123456/metadata \ -H "x-api-key: YOUR_API_KEY"{ "id": "doc123456", "source": { "type": "audio", "url": "https://example.com/earnings-call.mp3", "size": 24500000, "duration": "00:45:32" }, "processing": { "jobId": "job789012", "startTime": "2023-05-10T15:30:00Z", "endTime": "2023-05-10T16:00:00Z", "processingTime": 1800, "scenario": "SINGLE_FILE_DEFAULT" }, "content": { "language": "en", "wordCount": 2500, "sectionCount": 5, "speakers": 3 }, "user": { "id": "user123456", }}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.
Capsules API
Manage and interact with AI-generated content capsules using the Capsules API.
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 |