Skip to main content

Get All Product Dimensions

This endpoint supports both fetching all records and paginated results using different paths.

Endpoint

GET /api/v1/product-dimensions
Retrieves all product dimensions records in the system.

Response

response
array
Array of product dimensions objects

Status Codes

200
OK
Successfully retrieved list of product dimensions

Example Request

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

Example Response

[
  {
    "id": 1,
    "productId": 101,
    "lengthCm": 200.0,
    "widthCm": 90.0,
    "heightCm": 85.0,
    "dimensionUnit": "cm",
    "createdAt": "2024-01-15T10:30:00"
  },
  {
    "id": 2,
    "productId": 102,
    "lengthCm": 180.0,
    "widthCm": 80.0,
    "heightCm": 75.0,
    "dimensionUnit": "cm",
    "createdAt": "2024-01-16T14:20:00"
  }
]

Get Paginated Product Dimensions

Endpoint

GET /api/v1/product-dimensions/pagination
Retrieves product dimensions with pagination support.

Query Parameters

page
integer
default:"0"
Page number (zero-based index)
pageSize
integer
default:"10"
Number of records per page

Response

response
array
Array of product dimensions objects for the requested page

Status Codes

200
OK
Successfully retrieved paginated list of product dimensions

Example Request

curl -X GET "https://api.example.com/api/v1/product-dimensions/pagination?page=0&pageSize=10" \
  -H "Content-Type: application/json"

Example Response

[
  {
    "id": 1,
    "productId": 101,
    "lengthCm": 200.0,
    "widthCm": 90.0,
    "heightCm": 85.0,
    "dimensionUnit": "cm",
    "createdAt": "2024-01-15T10:30:00"
  },
  {
    "id": 2,
    "productId": 102,
    "lengthCm": 180.0,
    "widthCm": 80.0,
    "heightCm": 75.0,
    "dimensionUnit": "cm",
    "createdAt": "2024-01-16T14:20:00"
  }
]

Get Product Dimensions by Product ID

Endpoint

GET /api/v1/product-dimensions/product/{productId}
Retrieves product dimensions for a specific product.

Path Parameters

productId
integer
required
The ID of the product to retrieve dimensions for

Response

id
integer
Unique identifier for the product dimensions
productId
integer
ID of the associated product
lengthCm
number
Length of the product in centimeters
widthCm
number
Width of the product in centimeters
heightCm
number
Height of the product in centimeters
dimensionUnit
string
Unit of measurement for dimensions
createdAt
string
Timestamp when the record was created

Status Codes

200
OK
Successfully retrieved product dimensions
404
Not Found
Product dimensions not found for the given product

Example Request

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

Example Response

{
  "id": 1,
  "productId": 101,
  "lengthCm": 200.0,
  "widthCm": 90.0,
  "heightCm": 85.0,
  "dimensionUnit": "cm",
  "createdAt": "2024-01-15T10:30:00"
}

Build docs developers (and LLMs) love