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;
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
| 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;
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
| 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;
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
| 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;
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);
}