Skip to main content

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
ProductImageResponse[]
Array of product image objects

Response Codes

200
OK
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
  }
]

Get Product Images with Pagination

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
integer
default:"0"
Page number (zero-indexed)
pageSize
integer
default:"10"
Number of items per page

Response

Array
ProductImageResponse[]
Array of product image objects for the requested page

Response Codes

200
OK
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

productId
integer
required
ID of the product to retrieve images for

Response

Array
ProductImageResponse[]
Array of product image objects for the specified product

Response Codes

200
OK
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

productId
integer
required
ID of the product to retrieve images for

Response

Array
ProductImageResponse[]
Array of product image objects sorted by display order (ascending)

Response Codes

200
OK
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

productId
integer
required
ID of the product to retrieve the primary image for

Response

ProductImageResponse
object
The primary product image object

Response Codes

200
OK
Successfully retrieved primary product image
404
Not Found
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
}

Build docs developers (and LLMs) love