Skip to main content
curl -X GET "https://api.example.com/api/v1/product-images/1"
Retrieves detailed information about a specific product image.

Method and Path

GET /api/v1/product-images/{id}

Path Parameters

id
integer
required
The unique identifier of the product image to retrieve

Response

ProductImageResponse
object
The product image object

Response Codes

200
OK
Product image successfully retrieved
404
Not Found
Product image with the specified ID was not found

Response Example

{
  "id": 1,
  "productId": 101,
  "imageUrl": "https://example.com/images/sofa-front.jpg",
  "altText": "Modern grey sofa - front view",
  "displayOrder": 1
}

Error Response Example

{
  "status": 404,
  "error": "Not Found",
  "message": "Product image not found with id: 999"
}

Usage Examples

Get Product Image Details

curl -X GET "https://api.example.com/api/v1/product-images/1" \
  -H "Content-Type: application/json"

Get Product Image with JavaScript

fetch('https://api.example.com/api/v1/product-images/1', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Get Product Image with Python

import requests

response = requests.get('https://api.example.com/api/v1/product-images/1')
if response.status_code == 200:
    image = response.json()
    print(f"Image URL: {image['imageUrl']}")
    print(f"Alt Text: {image['altText']}")
else:
    print(f"Error: {response.status_code}")

Build docs developers (and LLMs) love