GET
Obtenir una imatge de producte per ID
Scope:
inventory:products.readhttps://api.holded.com/api/v2/products/{productId}/images/{imageId}Retrieves a single image from a product by its image identifier. The response includes the image URL, available sizes with dimensions, position, and description.
Paràmetres
Paràmetres de ruta
productId
stringobligatoriID del producte (ObjectId hexadecimal de 24 caràcters)
imageId
stringobligatoriID de la imatge (ObjectId hexadecimal de 24 caràcters)
Petició
python
import requests
url = "https://api.holded.com/api/v2/products/{productId}/images/{imageId}"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Respostes
Resposta
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
}
}
}Respostes exitoses
200Imatge trobadaapplication/jsonobject
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
Respostes d'error
401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json404Producte o imatge no trobatapplication/json429Límit de sol·licituds exceditapplication/json