Search.../

getReview( )

Developer Preview

Retrieves a review.

Description

The getReview() function returns a Promise that resolves to the retrieved review.

By default, an unpublished review is not returned. To retrieve an unpublished review, pass returnPrivateReviews as true.

Syntax

function getReview(reviewId: string, options: GetReviewOptions): Promise<Review>

getReview Parameters

NAME
TYPE
DESCRIPTION
reviewId
string

Review ID.

options
Optional
GetReviewOptions

Information about the reviews to retrieve.

Returns

Review.

Return Type:

Promise<
Review
>
NAME
TYPE
DESCRIPTION
_createdDate
Date

Date and time the review was created.

_id
string

Review ID.

_updatedDate
Date

Date and time the review was updated.

author
Author

Author of the review.

content
ReviewContent

Review content.

entityId
string

ID of the entity to review. For example, a Wix Stores product ID.

foundHelpful
number

Number of site visitors who found the review helpful.

foundUnhelpful
number

Number of site visitors who found the review unhelpful.

helpfulness
number

Helpfulness score.

Calculated by subtracting foundUnhelpful from foundHelpful.

moderation
Moderation

Moderation status of the review.

namespace
string

Review namespace. Currently integrated with Wix Stores, as stores.

origin
Origin

Provides information about the origin of the review. Organic reviews are created by site visitors or members. App reviews are created by apps even though a site visitor or member is the author of the review. Apps can not create or update organic reviews.

reply
Reply

Reply to the review.

reviewDate
Date

Date and time then review was written. It should the same time as created_date except for reviews that were imported from the other review system.

revision
string

Revision number, which increments by 1 each time the review is updated. To prevent conflicting changes, the current revision must be passed when updating the review. Ignored when creating a review.

verified
boolean

Indicates whether the review has been verified through a Verify Product Purchase call to the Review Product catalog SPI.

Was this helpful?

getReview example

Copy Code
1import { reviews } from 'wix-reviews.v2';
2
3 async function getReview(reviewId, options) {
4 try {
5 const result = await reviews.getReview(reviewId, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13