Skip to main content

Installation

Add this line to your application’s Gemfile:
And then execute:
Or install it yourself as:

Quick start

Initialization

Parameters:
  • 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

Parameters:
  • 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 (Proc).
Example:

Supported operations

Parameters:
  • 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

Parameters:
  • 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

get_status keyword arguments (conceptually StatusOptions):
  • main_task_id (required) – main task ID from create_operation / convenience helpers.
  • file_key (optional) – when set, requests status for that specific input file.
poll_status keyword arguments (extends the same inputs with polling fields):
  • main_task_id (required), file_key (optional) – as for get_status.
  • interval (optional) – milliseconds between polls, default 2000.
  • timeout (optional) – maximum total polling time in milliseconds, default 300000 (5 minutes).
  • on_update (optional) – proc/lambda receiving the status hash after each successful fetch.
Examples:

Complete workflow example