Parser Processing Status

Document Processing Status Checking Guide

Overview

The status checking endpoint allows you to monitor the progress of your document processing requests and retrieve results.

Endpoint

GET /documents/status/{requestId}

Base URL: https://api.yetanotherapi.com

Authentication

x-api-key: YOUR_API_KEY

Response States

1. Processing State

{
    "requestId": "string",
    "status": "PROCESSING",
    "type": "string",        // Document type (pdf, doc, etc.)
    "createdAt": "number"    // Unix timestamp
}

2. Completed State

{
    "requestId": "string",
    "status": "COMPLETED",
    "type": "string",
    "createdAt": "number",
    "data": "string"         // Extracted text content with page separators
}

3. Failed State

{
    "requestId": "string",
    "status": "FAILED",
    "type": "string",
    "createdAt": "number",
    "error": "string"        // Error description
}

Status Codes

  • 200: Status retrieved successfully

  • 404: Request ID not found

  • 401: Invalid API key

  • 500: Internal server error

Example Usage

cURL Example

curl --location 'https://api.yetanotherapi.com/documents/status/7a509d7c-f61b-4755-a09a-d5782ca27489' \
--header 'x-api-key: YOUR_API_KEY'

Python Example

import requests

api_key = "YOUR_API_KEY"
request_id = "7a509d7c-f61b-4755-a09a-d5782ca27489"

response = requests.get(
    f"https://api.yetanotherapi.com/documents/status/{request_id}",
    headers={"x-api-key": api_key}
)

print(response.json())

Polling Recommendations

  • Initial check: Wait 5 seconds after submission

  • Subsequent checks: Every 10 seconds

  • Maximum polling duration: 10 minutes

  • Implement exponential backoff for long-running processes

Error Handling

Error Code
Description

404-001

Request ID not found

404-002

Request expired (older than 7 days)

401-001

Invalid API key

500-001

Internal server error

Best Practices

  1. Implement exponential backoff in polling

  2. Handle all possible status codes

  3. Use webhook notifications for long-running processes

  4. Store request IDs for future reference

  5. Check expiration (7 days) for old requests

Last updated