thumbnails

Generate Thumbnail (JSON)

Generate a thumbnail from a URL using JSON request body.

post/api/v1/thumbnails/generate/json

Request

  • Base URL: https://docs.thedrive.ai (the document declares no server; this is the origin it was published from)
  • URL: https://docs.thedrive.ai/api/v1/thumbnails/generate/json
  • Auth: none declared

Headers

X-API-Keystring

Request body

urlstring uri nullable

URL to fetch the file from

url_headersobject nullable

Custom headers for URL fetching (e.g., Authorization)

widthinteger

Maximum thumbnail width

heightinteger

Maximum thumbnail height

qualityinteger

JPEG quality (1-100)

syncboolean

If true, wait for result. If false, return job_id immediately.

webhook_urlstring uri nullable

URL to POST the result when processing completes (for async requests)

response_type'url' | 'base64'

Response format for thumbnail delivery.

Example request

{
  "height": 400,
  "quality": 95,
  "response_type": "url",
  "sync": true,
  "url": "https://example.com/document.pdf",
  "url_headers": {
    "Authorization": "Bearer token123"
  },
  "width": 600
}

Response

Successful Response

successboolean
job_idstring required

Unique job identifier

status'pending' | 'processing' | 'completed' | 'failed'

Job processing status.

thumbnail_urlstring nullable

URL to the thumbnail image

thumbnail_base64string nullable

Base64-encoded thumbnail (if response_type='base64')

Example response

{
  "job_id": "job_abc123",
  "metadata": {
    "created_at": "2024-01-15T10:30:00Z",
    "file_category": "pdf",
    "file_size": 102400,
    "file_type": "pdf",
    "mime_type": "application/pdf",
    "original_filename": "document.pdf",
    "thumbnail_height": 400,
    "thumbnail_width": 600
  },
  "status": "completed",
  "success": true,
  "thumbnail_url": "https://storage.example.com/thumbnails/thumb_abc123.jpg"
}

Changes

No recorded changes to this operation across all 1 revision of this API.