Upload product image
Upload a product image (multipart field file) and set imageUrl. Replaces any previous image. Requires a Write key. Max 10MB. Allowed types: jpeg, png, webp, gif.
POST
/products/{productId}/imageAutorizzazione
AutorizzazioneToken Bearer (API key) · headerobbligatorioChiave API dell'organizzazione.
Parametri path
productIdstringobbligatorioCorpo della richiesta
obbligatoriomultipart/form-datafilestringobbligatorioImage file (jpeg, png, webp, gif). Max 10MB.
Risposte
200Uploaded
dataobjectobbligatorioMostra proprietàNascondi proprietà
urlstringobbligatorioimageUrlstringobbligatorio400Bad request
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
403Unauthorized
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
404Not found
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
413File too large
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
Richiesta
curl -X POST "https://dashboard.scango.ch/api/v1/products/string/image" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: multipart/form-data" \
-d '{
"file": "string"
}'const response = await fetch("https://dashboard.scango.ch/api/v1/products/string/image", {
method: "POST",
headers: {
"Autorizzazione": "Bearer YOUR_TOKEN",
"Content-Type": "multipart/form-data"
},
body: JSON.stringify({
"file": "string"
})
});Risposta
{
"data": {
"url": "string",
"imageUrl": "string"
}
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}