Saltar al contenido principal
GET

Obtener la imagen principal de un producto

Scope:inventory:products.read
https://api.holded.com/api/v2/products/{productId}/image

Retrieves the main (first) image of a product. Returns 404 if the product has no images.

Parámetros

Parámetros de ruta

productIdstringobligatorio

ID del producto (ObjectId hexadecimal de 24 caracteres)

Petición

python
import requests

url = "https://api.holded.com/api/v2/products/{productId}/image"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respuestas

Respuesta

json
{
  "id": "507f1f77bcf86cd799439011",
  "position": 1,
  "description": "string",
  "url": "string",
  "sizes": {
    "original": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "large": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "medium": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "small": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "thumbnail": {
      "url": "string",
      "width": 0,
      "height": 0
    }
  }
}

Respuestas exitosas

200Imagen principal encontradaapplication/json
object
idstringrequired

Unique identifier of the image

positionintegerrequired

Position of the image in the product gallery (1-indexed)

descriptionstring | nullrequired

Alt text or description of the image

urlstring | nullrequired

Primary image URL (original size or raw URL)

sizesobjectrequired

Available image sizes with URLs and dimensions

originalobject | null
largeobject | null
mediumobject | null
smallobject | null
thumbnailobject | null

Respuestas de error

401API key inválida o no proporcionadaapplication/json
403Permisos insuficientesapplication/json
404Producto no encontrado o sin imágenesapplication/json
429Límite de solicitudes excedidoapplication/json