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;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

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

System.out.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;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

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

System.out.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;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

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

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

System.out.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;

public class Main {
public static void main(String[] args) {
TestSdkConfig config = TestSdkConfig.builder()
.accessToken("YOUR_ACCESS_TOKEN")
.build();

TestSdk testSdk = new TestSdk(config);

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

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

System.out.println(response);
}
}