Skip to main content

ReviewsService

A list of all methods in the ReviewsService service. Click on the method name to view detailed information about that method.

MethodsDescription
listReviewsReturns a list of all the reviews sent to the user. Reviews are sorted by creation date, descending.
getReviewByIdReturns the details of a review
approveReviewUpdates the specified review with an approval decision.
denyReviewUpdates the specified review with a deny decision.

listReviews

Returns a list of all the reviews sent to the user. Reviews are sorted by creation date, descending.

  • HTTP Method: GET
  • Endpoint: /reviews

Return Type

List<Review>

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Review;
import java.util.List;

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val response: List<Review> = testSdk.reviews.listReviews();

println(response);
}

getReviewById

Returns the details of a review

  • HTTP Method: GET
  • Endpoint: /reviews/{review_id}

Parameters

NameTypeRequiredDescription
reviewIdStringThe ID of the review to retrieve.

Return Type

Review

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Review;

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val response: Review = testSdk.reviews.getReviewById("review_id");

println(response);
}

approveReview

Updates the specified review with an approval decision.

  • HTTP Method: PUT
  • Endpoint: /reviews/{review_id}/approve

Parameters

NameTypeRequiredDescription
reviewIdStringThe ID of the review to approve
reviewUpdateParamsReviewUpdateParamsRequest Body

Return Type

Review

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Review;
import com.swagger.petstore.models.ReviewUpdateParams;

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val reviewUpdateParams: ReviewUpdateParams = ReviewUpdateParams.builder()
.reason("reason")
.build();

val response: Review = testSdk.reviews.approveReview("review_id", reviewUpdateParams);

println(response);
}

denyReview

Updates the specified review with a deny decision.

  • HTTP Method: PUT
  • Endpoint: /reviews/{review_id}/deny

Parameters

NameTypeRequiredDescription
reviewIdStringThe ID of the review to deny
reviewUpdateParamsReviewUpdateParamsRequest Body

Return Type

Review

Example Usage Code Snippet

import com.swagger.petstore.TestSdk;
import com.swagger.petstore.config.TestSdkConfig;
import com.swagger.petstore.models.Review;
import com.swagger.petstore.models.ReviewUpdateParams;

fun main() {
val config: TestSdkConfig = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

val testSdk: TestSdk = TestSdk(config);

val reviewUpdateParams: ReviewUpdateParams = ReviewUpdateParams.builder()
.reason("reason")
.build();

val response: Review = testSdk.reviews.denyReview("review_id", reviewUpdateParams);

println(response);
}