Skip to main content

Installation

Quick start

Initialization

Config:
  • APIKey (required) – your D3 API key.
  • BaseURL (optional) – API base URL, default: https://api.dragdropdo.com.
  • Timeout (optional) – request timeout, default: 30 * time.Second.
  • Headers (optional) – additional headers to send with every request.

File upload

Options:
  • File (required) – file path string.
  • FileName (required) – original file name.
  • MimeType (optional) – MIME type (auto‑detected if omitted).
  • Parts (optional) – number of upload parts (auto‑calculated).
  • OnProgress (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. map[string]interface{}{"convert_to": "png"}).
Examples:

Create operations

Options:
  • Action (required) – "convert" | "compress" | "merge" | "zip" | "lock" | "unlock" | "reset_password".
  • FileKeys (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

StatusOptions (used by GetStatus):
  • MainTaskID (required) – main task ID from CreateOperation / convenience helpers.
  • FileKey (optional) – when non‑empty, requests status for that specific input file.
PollStatusOptions (embeds StatusOptions; used by PollStatus):
  • StatusOptions – nested struct with MainTaskID and FileKey as above.
  • Interval (optional) – time.Duration between polls (e.g. 2 * time.Second); default 2s if zero.
  • Timeout (optional) – maximum total polling duration (e.g. 5 * time.Minute); default 5m if zero.
  • OnUpdate (optional) – func(StatusResponse), invoked after each successful status fetch.
Examples:

Complete workflow example