Start an art upload
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/uploads \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "front-logo.png",
"sizeBytes": 482113
}
'import requests
url = "https://partners.dekhq.com/api/partners/v1/uploads"
payload = {
"filename": "front-logo.png",
"sizeBytes": 482113
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'front-logo.png', sizeBytes: 482113})
};
fetch('https://partners.dekhq.com/api/partners/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://partners.dekhq.com/api/partners/v1/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => 'front-logo.png',
'sizeBytes' => 482113
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://partners.dekhq.com/api/partners/v1/uploads"
payload := strings.NewReader("{\n \"filename\": \"front-logo.png\",\n \"sizeBytes\": 482113\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://partners.dekhq.com/api/partners/v1/uploads")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"front-logo.png\",\n \"sizeBytes\": 482113\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"front-logo.png\",\n \"sizeBytes\": 482113\n}"
response = http.request(request)
puts response.read_body{
"upload": {
"uploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"filename": "front-logo.png",
"status": "pending"
},
"uploadUrl": "https://uploads.example.com/quarantine/upload?signature=FAKE",
"uploadMethod": "PUT",
"uploadHeaders": {
"Content-Type": "image/png"
}
}{
"type": "https://docs.dekhq.com/api/partners/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "A query parameter or body field is missing or invalid. `errors[]` lists each field.",
"code": "invalid_request",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#unauthenticated",
"title": "Unauthenticated",
"status": 401,
"detail": "Missing or invalid credentials.",
"code": "unauthenticated",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Your credential is not enabled for the scope this endpoint needs.",
"code": "forbidden",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#payload_too_large",
"title": "Payload too large",
"status": 413,
"detail": "The request body is larger than this endpoint accepts.",
"code": "payload_too_large",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#upload_refused",
"title": "Upload refused",
"status": 422,
"detail": "The file can't be taken: its type isn't an art type we accept, it is empty or too large, its contents don't match its extension, or its bytes never arrived. `detail` says which. Start a new upload.",
"code": "upload_refused",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#rate_limited",
"title": "Rate limited",
"status": 429,
"detail": "More than the allowed requests per minute.",
"code": "rate_limited",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#internal",
"title": "Internal error",
"status": 500,
"detail": "An unexpected error on our side. It is logged; retry later.",
"code": "internal",
"requestId": "req_0123456789abcdef"
}Place orders
Start an art upload
Start uploading one art file. PUT its bytes to uploadUrl with exactly uploadHeaders, then finalize it. The file type and size limit are checked here and again at finalize; a file that can’t be taken is 422 upload_refused. The upload is yours: no other account can finalize or use it.
POST
/
api
/
partners
/
v1
/
uploads
Start an art upload
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/uploads \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "front-logo.png",
"sizeBytes": 482113
}
'import requests
url = "https://partners.dekhq.com/api/partners/v1/uploads"
payload = {
"filename": "front-logo.png",
"sizeBytes": 482113
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: 'front-logo.png', sizeBytes: 482113})
};
fetch('https://partners.dekhq.com/api/partners/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://partners.dekhq.com/api/partners/v1/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => 'front-logo.png',
'sizeBytes' => 482113
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://partners.dekhq.com/api/partners/v1/uploads"
payload := strings.NewReader("{\n \"filename\": \"front-logo.png\",\n \"sizeBytes\": 482113\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://partners.dekhq.com/api/partners/v1/uploads")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"front-logo.png\",\n \"sizeBytes\": 482113\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"front-logo.png\",\n \"sizeBytes\": 482113\n}"
response = http.request(request)
puts response.read_body{
"upload": {
"uploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"filename": "front-logo.png",
"status": "pending"
},
"uploadUrl": "https://uploads.example.com/quarantine/upload?signature=FAKE",
"uploadMethod": "PUT",
"uploadHeaders": {
"Content-Type": "image/png"
}
}{
"type": "https://docs.dekhq.com/api/partners/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "A query parameter or body field is missing or invalid. `errors[]` lists each field.",
"code": "invalid_request",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#unauthenticated",
"title": "Unauthenticated",
"status": 401,
"detail": "Missing or invalid credentials.",
"code": "unauthenticated",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Your credential is not enabled for the scope this endpoint needs.",
"code": "forbidden",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#payload_too_large",
"title": "Payload too large",
"status": 413,
"detail": "The request body is larger than this endpoint accepts.",
"code": "payload_too_large",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#upload_refused",
"title": "Upload refused",
"status": 422,
"detail": "The file can't be taken: its type isn't an art type we accept, it is empty or too large, its contents don't match its extension, or its bytes never arrived. `detail` says which. Start a new upload.",
"code": "upload_refused",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#rate_limited",
"title": "Rate limited",
"status": 429,
"detail": "More than the allowed requests per minute.",
"code": "rate_limited",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#internal",
"title": "Internal error",
"status": 500,
"detail": "An unexpected error on our side. It is logged; retry later.",
"code": "internal",
"requestId": "req_0123456789abcdef"
}Body
application/json
Response
Success.