Iniciar upload de imagem
curl --request POST \
--url https://api.korbit.com.br/v1/products/{id}/image-uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"sha256": "<string>",
"sizeBytes": 1048576
}
'import requests
url = "https://api.korbit.com.br/v1/products/{id}/image-uploads"
payload = {
"sha256": "<string>",
"sizeBytes": 1048576
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sha256: '<string>', sizeBytes: 1048576})
};
fetch('https://api.korbit.com.br/v1/products/{id}/image-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://api.korbit.com.br/v1/products/{id}/image-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([
'sha256' => '<string>',
'sizeBytes' => 1048576
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$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://api.korbit.com.br/v1/products/{id}/image-uploads"
payload := strings.NewReader("{\n \"sha256\": \"<string>\",\n \"sizeBytes\": 1048576\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.korbit.com.br/v1/products/{id}/image-uploads")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sha256\": \"<string>\",\n \"sizeBytes\": 1048576\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korbit.com.br/v1/products/{id}/image-uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sha256\": \"<string>\",\n \"sizeBytes\": 1048576\n}"
response = http.request(request)
puts response.read_body{
"expiresAt": "2023-11-07T05:31:56Z",
"height": 2,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imageUrl": "<string>",
"maxSizeBytes": 2097152,
"mediaType": "image/jpeg",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rejectionCode": "TOO_LARGE",
"requiredHeaders": {},
"sizeBytes": 1048576,
"status": "PENDING_UPLOAD",
"uploadUrl": "<string>",
"width": 2
}{
"expiresAt": "2023-11-07T05:31:56Z",
"height": 2,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imageUrl": "<string>",
"maxSizeBytes": 2097152,
"mediaType": "image/jpeg",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rejectionCode": "TOO_LARGE",
"requiredHeaders": {},
"sizeBytes": 1048576,
"status": "PENDING_UPLOAD",
"uploadUrl": "<string>",
"width": 2
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}Catálogo
Iniciar upload de imagem
Solicita um upload pré-assinado para a imagem do produto. Envie o arquivo direto ao storage com o body exato declarado (tipo, tamanho e checksum são verificados). Formatos: JPEG, PNG, WebP — até 2 MiB.
POST
/
v1
/
products
/
{id}
/
image-uploads
Iniciar upload de imagem
curl --request POST \
--url https://api.korbit.com.br/v1/products/{id}/image-uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"sha256": "<string>",
"sizeBytes": 1048576
}
'import requests
url = "https://api.korbit.com.br/v1/products/{id}/image-uploads"
payload = {
"sha256": "<string>",
"sizeBytes": 1048576
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sha256: '<string>', sizeBytes: 1048576})
};
fetch('https://api.korbit.com.br/v1/products/{id}/image-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://api.korbit.com.br/v1/products/{id}/image-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([
'sha256' => '<string>',
'sizeBytes' => 1048576
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>"
],
]);
$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://api.korbit.com.br/v1/products/{id}/image-uploads"
payload := strings.NewReader("{\n \"sha256\": \"<string>\",\n \"sizeBytes\": 1048576\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.korbit.com.br/v1/products/{id}/image-uploads")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sha256\": \"<string>\",\n \"sizeBytes\": 1048576\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.korbit.com.br/v1/products/{id}/image-uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sha256\": \"<string>\",\n \"sizeBytes\": 1048576\n}"
response = http.request(request)
puts response.read_body{
"expiresAt": "2023-11-07T05:31:56Z",
"height": 2,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imageUrl": "<string>",
"maxSizeBytes": 2097152,
"mediaType": "image/jpeg",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rejectionCode": "TOO_LARGE",
"requiredHeaders": {},
"sizeBytes": 1048576,
"status": "PENDING_UPLOAD",
"uploadUrl": "<string>",
"width": 2
}{
"expiresAt": "2023-11-07T05:31:56Z",
"height": 2,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"imageUrl": "<string>",
"maxSizeBytes": 2097152,
"mediaType": "image/jpeg",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rejectionCode": "TOO_LARGE",
"requiredHeaders": {},
"sizeBytes": 1048576,
"status": "PENDING_UPLOAD",
"uploadUrl": "<string>",
"width": 2
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 499,
"title": "<string>",
"type": "<string>",
"code": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
1 - 255Path Parameters
Body
application/json
Response
Default Response
Required range:
x >= 1Maximum string length:
2048Pattern:
^https://Available options:
2097152 Available options:
image/jpeg, image/png, image/webp Available options:
TOO_LARGE, UNSUPPORTED_TYPE, CORRUPT_IMAGE, DIMENSIONS_TOO_LARGE, DIMENSIONS_TOO_SMALL, UPLOAD_MISSING, SIZE_MISMATCH, CHECKSUM_MISMATCH, PROCESSING_FAILED Show child attributes
Show child attributes
Required range:
1 <= x <= 2097152Available options:
PENDING_UPLOAD, PROCESSING, READY, REJECTED, EXPIRED Maximum string length:
4096Required range:
x >= 1Was this page helpful?