Get All Product Images
curl -X GET "https://api.example.com/api/v1/product-images"
Retrieves a list of all product images in the system.
Method and Path
GET /api/v1/product-images
Response
Array of product image objectsShow ProductImageResponse properties
Unique identifier for the product image
ID of the product this image belongs to
Alternative text description for accessibility
Order in which the image should be displayed
Response Codes
Successfully retrieved list of product images
Response Example
[
{
"id": 1,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-front.jpg",
"altText": "Modern grey sofa - front view",
"displayOrder": 1
},
{
"id": 2,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-side.jpg",
"altText": "Modern grey sofa - side view",
"displayOrder": 2
},
{
"id": 3,
"productId": 102,
"imageUrl": "https://example.com/images/chair-front.jpg",
"altText": "Dining chair - front view",
"displayOrder": 1
}
]
curl -X GET "https://api.example.com/api/v1/product-images/pagination?page=0&pageSize=20"
Retrieves a paginated list of product images.
Method and Path
GET /api/v1/product-images/pagination
Query Parameters
Page number (zero-indexed)
Response
Array of product image objects for the requested page
Response Codes
Successfully retrieved paginated list of product images
Response Example
[
{
"id": 1,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-front.jpg",
"altText": "Modern grey sofa - front view",
"displayOrder": 1
},
{
"id": 2,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-side.jpg",
"altText": "Modern grey sofa - side view",
"displayOrder": 2
}
]
Get Images by Product ID
curl -X GET "https://api.example.com/api/v1/product-images/product/101"
Retrieves all images for a specific product.
Method and Path
GET /api/v1/product-images/product/{productId}
Path Parameters
ID of the product to retrieve images for
Response
Array of product image objects for the specified product
Response Codes
Successfully retrieved product images
Response Example
[
{
"id": 1,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-front.jpg",
"altText": "Modern grey sofa - front view",
"displayOrder": 1
},
{
"id": 2,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-side.jpg",
"altText": "Modern grey sofa - side view",
"displayOrder": 2
}
]
Get Ordered Images by Product ID
curl -X GET "https://api.example.com/api/v1/product-images/product/101/ordered"
Retrieves all images for a specific product, sorted by display order.
Method and Path
GET /api/v1/product-images/product/{productId}/ordered
Path Parameters
ID of the product to retrieve images for
Response
Array of product image objects sorted by display order (ascending)
Response Codes
Successfully retrieved ordered product images
Response Example
[
{
"id": 1,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-front.jpg",
"altText": "Modern grey sofa - front view",
"displayOrder": 1
},
{
"id": 2,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-side.jpg",
"altText": "Modern grey sofa - side view",
"displayOrder": 2
},
{
"id": 3,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-back.jpg",
"altText": "Modern grey sofa - back view",
"displayOrder": 3
}
]
Get Primary Image by Product ID
curl -X GET "https://api.example.com/api/v1/product-images/product/101/primary"
Retrieves the primary image for a specific product.
Method and Path
GET /api/v1/product-images/product/{productId}/primary
Path Parameters
ID of the product to retrieve the primary image for
Response
The primary product image object
Unique identifier for the product image
ID of the product this image belongs to
Alternative text description for accessibility
Order in which the image should be displayed
Response Codes
Successfully retrieved primary product image
Primary image not found for the specified product
Response Example
{
"id": 1,
"productId": 101,
"imageUrl": "https://example.com/images/sofa-front.jpg",
"altText": "Modern grey sofa - front view",
"displayOrder": 1
}