POST
Subir una imagen de producto
Scope:
inventory:products.writehttps://api.holded.com/api/v2/products/{productId}/imagesUploads an image and associates it with the specified product. Send the file as `multipart/form-data` using the `file` field. Allowed image types: jpeg, png, gif. Maximum 200 images per product.
Parámetros
Parámetros de ruta
productId
stringobligatorioID del producto (ObjectId hexadecimal de 24 caracteres)
Cuerpo de la petición
object
filestring<binary>required
Image file (jpeg, png, gif)
Petición
python
import requests
url = "https://api.holded.com/api/v2/products/{productId}/images"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
}
files = {"file": open("file.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())Respuestas
Respuesta
json
{
"id": "507f1f77bcf86cd799439011"
}Respuestas exitosas
201Imagen subida correctamenteapplication/jsonobject
idstringrequired
Respuestas de error
400Petición incorrectaapplication/json401API key inválida o no proporcionadaapplication/json403Permisos insuficientesapplication/json404Producto no encontradoapplication/json422Entidad no procesableapplication/json429Límite de solicitudes excedidoapplication/json