REST
POST
Multipart/form-data request
https://api.defaultuploader.com/v1/upload# multipart/form-data# Requires header — authorization: SECRET_CLIENT_TOKEN
To upload files, you need to obtain a secret key in your Default Uploader dashboard and
add the Authorization
header to the request:
curl --location 'https://api.defaultuploader.com/v1/upload' --header 'Authorization: YOUR_SECRET_CLIENT_TOKEN' --form 'file=@"/C:/path_to_file/file_example_JPG_100kB.jpg"'
You will receive the following response from the server:
[ // always returns a collection { "sourceName": "7uLbiXh7867H7dEPpsubV9.png", // unique file ID in the bucket "src": "https://api.defaultuploader.com/v1/image/upload/azxwjk4PCkLTFbuUYiQZ1j/7uLbiXh7867H7dEPpsubV9.png", // file path through API "originalSrc": "https://hb.vkcs.cloud/defaultuploader/image/png/7uLbiXh7867H7dEPpsubV9.png", // direct file path in the bucket "originalName": "dark_theme.png", // original file name "s3PathOriginal": "image/png/7uLbiXh7867H7dEPpsubV9.png", // original file path "s3Path": "image/png/7uLbiXh7867H7dEPpsubV9.png", // derivative file path "options": {}, // internal settings "size": 1400308, // size in bytes "mimeType": "image", "format": "png" }]
PUT
Multipart/form-data request with a presigned URL
In this guide, you will learn how to obtain a presigned URL.
https://api.defaultuploader.com/v1/upload/sign/7uLbiXh7867H7dEPpsubV9/5447114698657692x-params12d848eaca5282asdasda44766906ebx-token1427afc2d42ab2a200555c5d6b47a48b29cbffaac19cf572314ddafasddfd627ac0cdfabd6a134ggjhoda42728180a845e719ca0e0ce797ac/my-custom-folder.com?expirationIn=3600
GET
https://api.defaultuploader.com/v1/MIME_TYPE/upload/CLIENT_TOKEN/S3_PATH
v1 — API versionMIME_TYPE — media type (image, video, audio)CLIENT_TOKEN — token from the dashboardS3_PATH — file path in your S3 storage
A GET request returns a file with the following headers:
Key | Value |
---|---|
cache-control | public, max-age=604800 |
etag | image/png/7uLbiXh7867H7dEPpsubV9.png |
accept-ranges | bytes |
content-length | 1400308 |
content-range | bytes 0 - 1400308 |
content-type | image/png |
DELETE
Deletes the original file and all derivative files.
https://api.defaultuploader.com/v1/upload/S3_PATH_ORIGINAL# Requires header — authorization: SECRET_CLIENT_TOKEN