ReviewsService
A list of all methods in the ReviewsService service. Click on the method name to view detailed information about that method.
| Methods | Description |
|---|---|
| listReviews | Returns a list of all the reviews sent to the user. Reviews are sorted by creation date, descending. |
| getReviewById | Returns the details of a review |
| approveReview | Updates the specified review with an approval decision. |
| denyReview | Updates 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
| Name | Type | Required | Description |
|---|---|---|---|
| reviewId | String | ✅ | The 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
| Name | Type | Required | Description |
|---|---|---|---|
| reviewId | String | ✅ | The ID of the review to approve |
| reviewUpdateParams | ReviewUpdateParams | ✅ | Request 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
| Name | Type | Required | Description |
|---|---|---|---|
| reviewId | String | ✅ | The ID of the review to deny |
| reviewUpdateParams | ReviewUpdateParams | ✅ | Request 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);
}
}