Appearance
Reviews and ratings
The repository has both product reviews and newer user reviews with per-product rating metrics. Use the matching create/update/read family; their field names differ.
Access labels such as Origin + Brand key + Customer are defined in Headers and access. Each endpoint ends in a Try it console; set the host and keys once in its Settings tab or on the overview.
Update review
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/user/review | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.reviewId | number | yes | — |
body.payload.title | string | optional | — |
body.payload.text | string | optional | — |
body.payload.overallRating | number | optional | Minimum (1); Maximum (5) |
body.payload.assets | string | optional | — |
Example:
bash
curl -X PUT "$BASE_URL/api/v1/user/review" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"reviewId":1}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/review_controller.js:12 → updateReview; routes: routes/v1/review_route.js:79; service: _updateReview (app/v1/service/review_service.js:176).
Add review
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/review | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.title | string | optional | — |
body.payload.text | string | optional | — |
body.payload.overallRating | number | yes | Minimum (1); Maximum (5) |
body.payload.assets | string | optional | — |
body.payload.productId | number | yes | — |
body.payload.authCode | string | yes | Whitespace trimmed |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/review" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"overallRating":5,"productId":1,"authCode":"<AUTH_CODE>"}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/review_controller.js:42 → addReview; routes: routes/v1/review_route.js:69; service: _addReview (app/v1/service/review_service.js:10).
Get review by ID
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/review/:reviewId | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.reviewId | number | yes | — |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/review/1" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/review_controller.js:75 → getReviewById; routes: routes/v1/review_route.js:89; service: _getReview (app/v1/service/review_service.js:221).
Get all reviews
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/review/product/:productId | Origin + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.productId | number | yes | — |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/review/product/1" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/review_controller.js:101 → getAllReviews; routes: routes/v1/review_route.js:99; service: _getAllReview (app/v1/service/review_service.js:251).
Get all reviews by product slug
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/review/product-slug | Origin + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.slug | string | yes | — |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/review/product-slug" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"slug":"example"}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/review_controller.js:128 → getAllReviewsByProductSlug; routes: routes/v1/review_route.js:109; service: _getAllReviewsByProductSlug (app/v1/service/review_service.js:281).
Check review for product
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/review/product/:productId/allow | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.productId | number | yes | — |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/review/product/1/allow" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, allowReview.
Source: app/v1/controller/review_controller.js:157 → checkReviewForProduct; routes: routes/v1/review_route.js:119; service: _checkReviewForProduct (app/v1/service/review_service.js:322).
Add user review relation
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/user-review | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.reviewId | number | yes | — |
body.payload.wasHelpful | boolean | yes | — |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/user-review" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"reviewId":1,"wasHelpful":true}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/userReviewRelation_controller.js:9 → addUserReviewRelation; routes: routes/v1/userReviewRelation_route.js:8; service: _addUserReviewRelation (app/v1/service/userReviewRelation_service.js:5).
Update user review relation
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/user/user-review | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.userReviewRelationId | number | yes | — |
body.payload.wasHelpful | boolean | yes | — |
Example:
bash
curl -X PUT "$BASE_URL/api/v1/user/user-review" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"userReviewRelationId":1,"wasHelpful":true}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/userReviewRelation_controller.js:37 → updateUserReviewRelation; routes: routes/v1/userReviewRelation_route.js:18; service: _updateUserReviewRelation (app/v1/service/userReviewRelation_service.js:38).
Get all user review relations
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/user-review/:reviewId | Origin + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.reviewId | number | yes | — |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/user-review/1" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/userReviewRelation_controller.js:64 → getAllUserReviewRelations; routes: routes/v1/userReviewRelation_route.js:28; service: _getAllUserReviewRelations (app/v1/service/userReviewRelation_service.js:61).
Add user review
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/user-review/create | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.title | string | optional | Whitespace trimmed |
body.payload.description | string | optional | Whitespace trimmed |
body.payload.overall_rating | number | yes | Minimum (1); Maximum (5) |
body.payload.productId | number | yes | — |
body.payload.review_metric | array of object | yes | — |
body.payload.review_metric[].id | number | yes | — |
body.payload.review_metric[].rating | number | yes | — |
body.payload.review_metric[].comments | string | optional | — |
Example:
bash
curl -X POST "$BASE_URL/api/v1/user/user-review/create" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{"overall_rating":5,"productId":1,"review_metric":[{"id":1,"rating":1}]}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/user_review_controller.ts:18 → addUserReview; routes: routes/v1/user_review_route.ts:9; service: _addUserReview (app/v1/service/user_review_service.ts:16).
Get all user reviews
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/user-reviews | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
query.productId | array of number | optional | — |
query.startDate | string | optional | isoDate() |
query.endDate | string | optional | isoDate() |
productId is converted to a string array by Lodash split. startDate and endDate are only added when both are supplied.
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/user-reviews" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: User review records matching the product/date filters.
Source: app/v1/controller/user_review_controller.ts:67 → getAllUserReviews; routes: routes/v1/user_review_route.ts:19; service: _getAllUserReviews (app/v1/service/user_review_service.ts:182).
Get user review by ID
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/user-reviews/:id | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.id | string | yes | No controller schema |
Example:
bash
curl -X GET "$BASE_URL/api/v1/user/user-reviews/<ID>" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/user_review_controller.ts:104 → getUserReviewById; routes: routes/v1/user_review_route.ts:29; service: _getUserReviewById (app/v1/service/user_review_service.ts:287).
Update user review
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/user/user-review/:userReviewId | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.title | string | optional | Whitespace trimmed |
body.payload.description | string | optional | Whitespace trimmed |
body.payload.overall_rating | number | optional | Minimum (1); Maximum (5) |
body.payload.status | string | optional | Whitespace trimmed; Allowed values ("locked", "open", "submitted") |
body.payload.review_metric | array of object | optional | — |
body.payload.review_metric[].id | number | yes | — |
body.payload.review_metric[].rating | number | yes | — |
body.payload.review_metric[].comments | string | optional | — |
path.userReviewId | string | yes | No controller schema |
Example:
bash
curl -X PUT "$BASE_URL/api/v1/user/user-review/<USERREVIEWID>" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN" \
-H 'Content-Type: application/json' \
--data-raw '{"payload":{}}'Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/user_review_controller.ts:127 → updateUserReview; routes: routes/v1/user_review_route.ts:39; service: _updateUserReview (app/v1/service/user_review_service.ts:375).
Delete user review
| Method | URL path | Required access |
|---|---|---|
DELETE | /api/v1/user/user-review/:userReviewId | Origin + Brand key + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.userReviewId | string | yes | No controller schema |
Example:
bash
curl -X DELETE "$BASE_URL/api/v1/user/user-review/<USERREVIEWID>" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data.
Source: app/v1/controller/user_review_controller.ts:182 → deleteUserReview; routes: routes/v1/user_review_route.ts:49; service: _deleteUserReview (app/v1/service/user_review_service.ts:498).
Get all review metric for product
Fetch the review questions or rating metrics configured for the product.
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/review_metric/:productId | Origin + Brand key + Customer |
GET | /api/v1/brand/review_metric/:productId | Origin + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.productId | number | yes | Integer |
Example (first URL):
bash
curl -X GET "$BASE_URL/api/v1/user/review_metric/1" \
-H "Origin: $ORIGIN" \
-H "api-key: $API_KEY" \
-H "Authorization: Bearer $CUSTOMER_TOKEN"Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, data.
Source: app/v1/controller/user_review_controller.ts:204 → getAllReviewMetricForProduct; routes: routes/v1/user_review_route.ts:69; service: _getAllReviewMetricForProduct (app/v1/service/user_review_service.ts:526).