Skip to main content

Endpoint

GET /api/v1/product-reviews
Retrieve a list of all product reviews in the system.

Response

Returns an array of product review objects.
reviews
array
Array of product review objects
id
integer
required
Unique identifier for the review
productId
integer
required
ID of the product being reviewed
userId
integer
required
ID of the user who created the review
rating
integer
required
Rating given to the product (typically 1-5)
comment
string
Text comment or review description
createdAt
string
Timestamp when the review was created (ISO 8601 format)

Status Codes

200
OK
Successfully retrieved list of product reviews

Example Request

curl -X GET "https://api.example.com/api/v1/product-reviews"

Example Response

[
  {
    "id": 1,
    "productId": 101,
    "userId": 501,
    "rating": 5,
    "comment": "Excellent quality sofa! Very comfortable and looks great in my living room.",
    "createdAt": "2024-01-15T10:30:00"
  },
  {
    "id": 2,
    "productId": 102,
    "userId": 502,
    "rating": 4,
    "comment": "Good dining table, but assembly was a bit challenging.",
    "createdAt": "2024-01-16T14:20:00"
  },
  {
    "id": 3,
    "productId": 101,
    "userId": 503,
    "rating": 5,
    "comment": "Beautiful design and great value for money!",
    "createdAt": "2024-01-17T09:15:00"
  }
]

Notes

  • This endpoint returns all reviews in the system without filtering
  • For paginated results, use the pagination endpoint
  • To get reviews for a specific product, use the product reviews endpoint
  • Results are not ordered by default; use the ordered endpoint for chronological sorting

Build docs developers (and LLMs) love