Download OpenAPI specification:Download
ReviewService API spec (Default Adapter)
API documentation for ReviewService default adapter.
Retrieves list of review by user for organizations
userId required | string (userId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a user. |
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "comment": "string",
- "isAnonymous": true,
- "source": "user",
- "target": "user",
- "rate": 1,
- "reviewedBy": "0123456789ab0123456789ab",
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}, - "createdAt": "2022-01-01T00:00:00.000Z",
- "updatedAt": "2022-01-01T00:00:00.000Z"
}
]
}
Update a organization review by user
Validations
- User can only update their own reviews
Side Effects
- The
reviewStats
field for the organization service will be updated
- If this fails, then a message will be logged and the request will still succeed
reviewId required | string (reviewId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a review. |
userId required | string (userId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a user. |
Patch a review request body.
comment | string The body comment for a review |
isAnonymous | boolean Flag to indicate whether a review is anonymous or not. |
rate | integer [ 1 .. 5 ] The rating the reviewer gave to the reviewee. Technically this can be any number, but generally it is a number between 1 and 5. |
subRates | object The sub-ratings the reviewer gave to the reviewee. These ratings can be used to rate different aspects of the reviewee. Specify the name of the subRatings with a string key, and the value with a number between 1 and 5. |
customFields | object (customFields.field) Custom fields that have been added to the |
{- "comment": "string",
- "isAnonymous": true,
- "rate": 1,
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}
}
{- "id": "0123456789ab0123456789ab"
}
Delete a organization review by user
Validations
- User can only delete their own reviews
Side Effects
- The
reviewStats
field for the organization service will be updated
- If this fails, then a message will be logged and the request will still succeed
reviewId required | string (reviewId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a review. |
userId required | string (userId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a user. |
{- "code": "string",
- "message": "string",
- "target": "string",
- "details": [
- { }
], - "innererror": {
- "code": "string",
- "innererror": null
}
}
Retrieves reviews by org id
orgId required | string (orgId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of an organization. |
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "comment": "string",
- "isAnonymous": true,
- "source": "user",
- "target": "user",
- "rate": 1,
- "reviewedBy": "0123456789ab0123456789ab",
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}, - "createdAt": "2022-01-01T00:00:00.000Z",
- "updatedAt": "2022-01-01T00:00:00.000Z"
}
]
}
Create a new review for an organization.
Validations
- Only order that has been completed can be reviewed
- reviewBy must be a login user id
Side Effects
- The
reviewStats
field for the organization service will be updated
- If this fails, then a message will be logged and the request will still succeed
orgId required | string (orgId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of an organization. |
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
Post a review request body.
comment | string The body comment for a review |
isAnonymous | boolean Flag to indicate whether a review is anonymous or not. |
source | string Enum: "user" "organization" The type of the reviewer (the one performing the review) |
target | string Enum: "user" "organization" "product" The type of the reviewee (the one receiving the review) |
rate | integer [ 1 .. 5 ] The rating the reviewer gave to the reviewee. Technically this can be any number, but generally it is a number between 1 and 5. |
reviewedBy | string (objectId) ^[0-9a-z]{24}$ The unique identifier of the reviewer. |
subRates | object The sub-ratings the reviewer gave to the reviewee. These ratings can be used to rate different aspects of the reviewee. Specify the name of the subRatings with a string key, and the value with a number between 1 and 5. |
customFields | object (customFields.field) Custom fields that have been added to the |
{- "comment": "string",
- "isAnonymous": true,
- "source": "user",
- "target": "user",
- "rate": 1,
- "reviewedBy": "0123456789ab0123456789ab",
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}
}
{- "id": "0123456789ab0123456789ab"
}
Retrive reviews for one user by organizations
userId required | string (userId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a user. |
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "comment": "string",
- "isAnonymous": true,
- "source": "user",
- "target": "user",
- "rate": 1,
- "reviewedBy": "0123456789ab0123456789ab",
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}, - "createdAt": "2022-01-01T00:00:00.000Z",
- "updatedAt": "2022-01-01T00:00:00.000Z"
}
]
}
Create a new review for an user by organization.
Validations
- Login user must be in organization
- Only order that has been completed can be reviewed
Side Effects
- The
reviewStats
field for the user service will be updated
- If this fails, then a message will be logged and the request will still succeed
userId required | string (userId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a user. |
$expand | string Include extra information that are not included in responses by default in the response.
By default, the fields that supports this query contain only You can expand recursively by specifying nested fields after a dot (.). until For example, requesting You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints. You can expand multiple objects at once by identifying multiple items in comma-separated style. Examples:Include full category and organization information in the response. Before expanding,
By using $expand parameter,
It will returns full information:
|
Post a review request body.
comment | string The body comment for a review |
isAnonymous | boolean Flag to indicate whether a review is anonymous or not. |
source | string Enum: "user" "organization" The type of the reviewer (the one performing the review) |
target | string Enum: "user" "organization" "product" The type of the reviewee (the one receiving the review) |
rate | integer [ 1 .. 5 ] The rating the reviewer gave to the reviewee. Technically this can be any number, but generally it is a number between 1 and 5. |
reviewedBy | string (objectId) ^[0-9a-z]{24}$ The unique identifier of the reviewer. |
subRates | object The sub-ratings the reviewer gave to the reviewee. These ratings can be used to rate different aspects of the reviewee. Specify the name of the subRatings with a string key, and the value with a number between 1 and 5. |
customFields | object (customFields.field) Custom fields that have been added to the |
{- "comment": "string",
- "isAnonymous": true,
- "source": "user",
- "target": "user",
- "rate": 1,
- "reviewedBy": "0123456789ab0123456789ab",
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}
}
{- "id": "0123456789ab0123456789ab"
}
Retrieves reviews for one organization
Validations
- Login user must be in organization
orgId required | string (orgId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of an organization. |
{- "total": 100,
- "count": 100,
- "value": [
- {
- "id": "0123456789ab0123456789ab",
- "comment": "string",
- "isAnonymous": true,
- "source": "user",
- "target": "user",
- "rate": 1,
- "reviewedBy": "0123456789ab0123456789ab",
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}, - "createdAt": "2022-01-01T00:00:00.000Z",
- "updatedAt": "2022-01-01T00:00:00.000Z"
}
]
}
Update a review created by one org
Validations
- Login user must be admin or owner for the organization
Side Effects
- The
reviewStats
field for the user service will be updated
- If this fails, then a message will be logged and the request will still succeed
orgId required | string (orgId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of an organization. |
reviewId required | string (reviewId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a review. |
Patch a review request body.
comment | string The body comment for a review |
isAnonymous | boolean Flag to indicate whether a review is anonymous or not. |
rate | integer [ 1 .. 5 ] The rating the reviewer gave to the reviewee. Technically this can be any number, but generally it is a number between 1 and 5. |
subRates | object The sub-ratings the reviewer gave to the reviewee. These ratings can be used to rate different aspects of the reviewee. Specify the name of the subRatings with a string key, and the value with a number between 1 and 5. |
customFields | object (customFields.field) Custom fields that have been added to the |
{- "comment": "string",
- "isAnonymous": true,
- "rate": 1,
- "subRates": {
- "quality": 5,
- "price": 3,
- "delivery": 4
}, - "customFields": {
- "title": "This is awesome!"
}
}
{- "id": "0123456789ab0123456789ab"
}
Delete a review created by one org
Validations
- Login user must be admin or owner for the organization
Side Effects
- The
reviewStats
field for the user service will be updated
- If this fails, then a message will be logged and the request will still succeed
orgId required | string (orgId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of an organization. |
reviewId required | string (reviewId) ^[0-9a-z]{24}$ Example: 0123456789ab0123456789ab A unique identifier of a review. |
{- "code": "string",
- "message": "string",
- "target": "string",
- "details": [
- { }
], - "innererror": {
- "code": "string",
- "innererror": null
}
}