Skip to main content
  1. Generate an API key.
  2. Upload a file.
  3. Create an operation.
  4. Poll for status.

1. Get an API key

API keys are managed through the D3 dashboard. To generate an API key:
  1. Sign in to your account at dragdropdo.com/auth/signin
  2. Navigate to your Account section
  3. Go to the Generate API Key section
  4. Create a new API key with a descriptive name
  5. Copy and securely store your API key – it is only shown once
Once you have your API key, you can use it to initialize the client:
import { Dragdropdo } from "dragdropdo-sdk";

const client = new Dragdropdo({
apiKey: "d3_live_xxx", // Your API key from the dashboard
baseURL: "https://api.dragdropdo.com",
});

Store your api_key securely – it is only shown once in the dashboard. Authentication for /v1/biz endpoints uses this raw key.

2. Upload a file

Uploads are done in two steps using presigned URLs.
# Step 1: Initiate upload
curl -X POST https://api.dragdropdo.com/v1/biz/initiate-upload \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "file_name": "document.pdf",
    "size": 1234567,
    "mime_type": "application/pdf",
    "parts": 1
  }'

# Step 2: Upload to presigned URL

curl -X PUT "https://minio/..." \
 -H "Content-Type: application/pdf" \
 --data-binary "@document.pdf"

# Step 3: Complete upload

curl -X POST https://api.dragdropdo.com/v1/biz/complete-upload \
 -H "Authorization: Bearer your-api-key" \
 -H "Content-Type: application/json" \
 -d '{
"file_key": "file_key_123"
}'

3. Create an operation

curl -X POST https://api.dragdropdo.com/v1/biz/do \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "convert",
    "file_keys": ["file_key_123"],
    "parameters": {
      "convert_to": "png"
    },
    "notes": {
      "user_id": "user-123",
      "source": "api"
    }
  }'
Response:
{
  "main_task_id": "task_abc123"
}

4. Poll for status

# Single status check
curl -X GET https://api.dragdropdo.com/v1/biz/status/task_abc123 \
  -H "Authorization: Bearer your-api-key"

# Poll in a loop (bash example)

while true; do
response=$(curl -s -X GET https://api.dragdropdo.com/v1/biz/status/task_abc123 \
 -H "Authorization: Bearer your-api-key")

status=$(echo $response | jq -r '.operation_status')
echo "Status: $status"

if [ "$status" = "completed" ] || [ "$status" = "failed" ]; then
echo $response | jq '.'
break
fi

sleep 2
done

Response:
{
  "operation_status": "completed",
  "files_data": [
    {
      "file_key": "file_key_123_result",
      "status": "completed",
      "download_link": "/v1/download/file_key_123_result"
    }
  ]
}
For production integrations we recommend configuring webhooks instead of / in addition to polling. See Business API → Webhooks.