ayasoftware / magento2-review-api
Review WebAPI
Package info
github.com/ayasoftware/magento2-review-api
Type:magento2-module
pkg:composer/ayasoftware/magento2-review-api
Requires
- php: ^8.3 || ^8.4
- magento/module-catalog: *
- magento/module-configurable-product: *
- magento/module-review: >=100.2.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Overview
Currently, Magento 2 does not provide the REST API for the Reviews Extension of the products. This module implement WebAPI for product reviews (partially)
Tested compatibility target: Magento Open Source / Adobe Commerce 2.4.8 with PHP 8.3 and 8.4.
Module allow:
- Get one review
- Create review with ratings
- Update review with ratings
- Search reviews
- Get product reviews
| Resource | Request method | Description |
|---|---|---|
| /V1/reviews/:id | GET | Get one review |
| /V1/reviews/:id | PUT | Update review |
| /V1/reviews/:id | DELETE | Delete review |
| /V1/reviews/ | POST | Create review |
| /V1/reviews/ | GET | Search reviews |
| /V1/products/:sku/reviews | GET | Get product reviews |
Get product reviews
GET /V1/products/:sku/reviews returns:
{
"items": [ ],
"requested_sku": "WT09-S-Yellow",
"resolved_sku": "WT09",
"resolved_from_configurable_child": true,
"message": "SKU \"WT09-S-Yellow\" is a variation of configurable product \"WT09\". Magento attaches reviews to the configurable parent, never to individual variations, so the reviews shown here are \"WT09\"'s reviews, not specific to this variation."
}
If sku is a configurable product's simple child (variation) and has no reviews of its own, the
reviews of its configurable parent are returned instead, since Magento always attaches a review to
the entity that was on display when it was submitted — for a configurable's variations, that is
always the parent. resolved_from_configurable_child and message are only set to a truthy/non-null
value in that case; otherwise resolved_sku equals requested_sku and message is null.
ACL
The module exposes a custom Magento ACL resource:
Ayasoftware_ReviewApi::reviewapiAyasoftware_ReviewApi::reviews
Docs for adding a new review with ratings
Install
To install this module please use composer dependency manager. In Your Magento2 folder please do execute:
composer require ayasoftware/magento2-review-api php bin/magento setup:upgrade