Skip to main content

List Product Image

Retrieves a list of all images associated with a specific product.

HTTP Request

GET/api/products/:product_id/images

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
product_idIntegerYesUnique ID of the product

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results to return per page
offsetinteger0Number of results to skip before returning results

Example Requests

1import requests
2
3# List all images for a specific product
4response = requests.get('http://www.example.com/api/products/123/images',
5  headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# List images with pagination
10response = requests.get('http://www.example.com/api/products/123/images', params={
11  'limit': 20,
12  'offset': 0
13}, headers={'Authorization': 'Token <your_api_key>'})
14print(response.json())

Status Codes

CodeDescription
200Product images retrieved successfully
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied
404Not Found - Product not found

Response Fields

FieldTypeDescription
idintegerUnique identifier for the image
typestringImage type (e.g., "JPEG", "PNG", "WEBP")
userobjectUser who uploaded the image
namestringOriginal filename of the image
fstringFile URL/path
sizeintegerFile size in bytes
descriptionstringImage description
widthintegerImage width in pixels
heightintegerImage height in pixels
human_readable_sizestringHuman-readable file size (e.g., "2.5 MB")
modestringImage color mode (e.g., "RGB", "CMYK")
created_atdatetimeImage upload timestamp
updated_atdatetimeImage last update timestamp

User Data Structure

FieldTypeDescription
idintegerUnique ID of the user
usernamestringUsername of the user
full_namestringFull name of the user