Finalize an art upload
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize"
payload = {}
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({})
};
fetch('https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize', 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/{uploadId}/finalize",
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([
]),
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/{uploadId}/finalize"
payload := strings.NewReader("{}")
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/{uploadId}/finalize")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize")
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 = "{}"
response = http.request(request)
puts response.read_body{
"upload": {
"uploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"filename": "front-logo.png",
"status": "finalized"
}
}{
"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#not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource for your credential: it does not exist, or it belongs to a client your credential is not linked to.",
"code": "not_found",
"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
Finalize an art upload
Check the bytes you PUT and store the file. Send {}. Finalizing an upload again returns it unchanged. An upload that does not exist, or belongs to another account, is 404 not_found.
POST
/
api
/
partners
/
v1
/
uploads
/
{uploadId}
/
finalize
Finalize an art upload
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize"
payload = {}
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({})
};
fetch('https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize', 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/{uploadId}/finalize",
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([
]),
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/{uploadId}/finalize"
payload := strings.NewReader("{}")
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/{uploadId}/finalize")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/uploads/{uploadId}/finalize")
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 = "{}"
response = http.request(request)
puts response.read_body{
"upload": {
"uploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"filename": "front-logo.png",
"status": "finalized"
}
}{
"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#not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource for your credential: it does not exist, or it belongs to a client your credential is not linked to.",
"code": "not_found",
"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"
}Path Parameters
Body
application/json
The body is of type object.