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 dashboardbaseURL: "https://api.dragdropdo.com",});
Store your api_key securely – it is only shown once in the dashboard. Authentication for /api/v1 endpoints uses this raw key.
Uploads use presigned URLs. The flow is: POST /api/v1/initiate-upload (get file_key, object_name, upload_id, and presigned URLs) → HTTP PUT each file part to its URL (collect the ETag from each response) → POST /api/v1/complete-upload to finalize the multipart upload and register the file for operations. The complete-upload request body includes file_key, object_name, upload_id, and parts (each part’s etag and part_number); the JSON response includes message and file_key. See Upload → Complete upload for the full request and response schema, authentication, and ETag handling. Official SDKs perform all of these steps when you call uploadFile / upload_file.
# Step 1: Initiate uploadcurl -X POST https://api.dragdropdo.com/api/v1/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 (use ETag from response headers in step 3)curl -X PUT "https://minio/..." \ -H "Content-Type: application/pdf" \ --data-binary "@document.pdf"# Step 3: Complete upload — required to finalize the upload and obtain a usable file_keycurl -X POST https://api.dragdropdo.com/api/v1/complete-upload \ -H "Authorization: Bearer your-api-key" \ -H "Content-Type: application/json" \ -d '{ "file_key": "file_key_123", "object_name": "external/...", "upload_id": "upload-id-from-initiate-response", "parts": [ { "etag": "etag-from-put-response", "part_number": 1 } ] }'