Skip to main content

Installation

Quick start

Initialization

Config:
  • api_key (required) – your D3 API key.
  • base_url (optional) – API base URL, default: https://api.dragdropdo.com.
  • timeout (optional) – request timeout in ms, default: 30000.
  • headers (optional) – additional headers to send with every request.

File upload

Options:
  • file (required) – file path string.
  • file_name (required) – original file name.
  • mime_type (optional) – MIME type (auto‑detected if omitted).
  • parts (optional) – number of upload parts (auto‑calculated).
  • on_progress (optional) – progress callback.
Example:

Supported operations

Options:
  • ext (required) – file extension (e.g. pdf, jpg).
  • action (optional) – specific action (convert, compress, …).
  • parameters (optional) – parameters to validate (e.g. ['convert_to' => 'png']).
Examples:

Create operations

Options:
  • action (required) – "convert" | "compress" | "merge" | "zip" | "lock" | "unlock" | "reset_password".
  • file_keys (required) – array of file keys from upload.
  • parameters (optional) – action‑specific parameters.
  • notes (optional) – user metadata.
Examples:

Convenience helpers

The client exposes shorthand helpers:

Status & polling

getStatus options (same shape as single‑fetch inputs for polling):
  • main_task_id (required) – main task ID from createOperation / convenience helpers.
  • file_key (optional) – when set, requests status for that specific input file.
pollStatus options (includes all getStatus keys, plus polling controls):
  • main_task_id (required), file_key (optional) – as above.
  • interval (optional) – milliseconds between polls, default 2000.
  • timeout (optional) – maximum total polling time in milliseconds, default 300000 (5 minutes).
  • on_update (optional) – callable receiving the status array after each successful fetch.
Examples:

Complete workflow example