Git Product home page Git Product logo

magento2-review-api's Introduction

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)

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

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 divante/magento2-review-api
php bin/magento setup:upgrade 

magento2-review-api's People

Contributors

afirlejczyk avatar ahinkle avatar bartoszherba avatar igormatkovic avatar pkarw avatar youanden avatar zukilover avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

magento2-review-api's Issues

Tag the 1.0.0 release

Tag the 1.0.0 release so projects using the module are able to use:

"minimum-stability": "stable",

in their composer.json file.

ratings object empty

Hi,

When posting the object to Magento ver. 2.3.5-p1
The ratings object is empty.

post object
{
"review": {
"title": "Review title",
"detail": "Empty review datails!",
"nickname": "Raoul",
"ratings": [
{
"rating_name": "Rating",
"value": 5
},
{
"rating_name": "Quality",
"value": 5
}
],
"review_entity": "product",
"review_status": 2,
"entity_pk_value": 795
}
}

return

{
"id": 9,
"title": "Review title",
"detail": "Empty review datails!",
"nickname": "Raaaaaoullll",
"ratings": [],
"review_entity": "product",
"review_type": 2,
"review_status": 2,
"created_at": "2021-06-29 05:04:05",
"entity_pk_value": 795,
"store_id": 1,
"stores": [
0,
1
]
}

PHP and Composer Version

Getting the following error for Magento 2.4 Package divante/magento2-review-api has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version .
I'm using PHP 7.4.16 and Composer 2.0.11

Version not compatable

Package divante/magento2-review-api at version has a PHP requirement incompatible with your PH
P version (7.4.3)

Submit the module to Packagist

Submit the module to https://packagist.org/, so it won't be necessary to manually configure the repository URL in order to install the module using Composer.

I.e. this part of the installation instructions will not needed anymore:

config repositories.divante vcs https://github.com/DivanteLtd/magento2-review-api.git

Can't POST review with customer token

I try to POST a comment with a customer token but it doesn't work. I recive this error :

{
    "message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "Magento_Review::reviews_all"
    },
    "trace": "#0 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/module-webapi/Controller/Rest/RequestValidator.php(68): Magento\\Webapi\\Controller\\Rest\\RequestValidator->checkPermissions()\n#1 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(80): Magento\\Webapi\\Controller\\Rest\\RequestValidator->validate()\n#2 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest\\InputParamsResolver->resolve()\n#3 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\InputParamsResolver\\Interceptor->___callParent('resolve', Array)\n#4 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\InputParamsResolver\\Interceptor->Magento\\Framework\\Interception\\{closure}()\n#5 /var/www/vhosts/store-api.silverwax.ca/httpdocs/generated/code/Magento/Webapi/Controller/Rest/InputParamsResolver/Interceptor.php(26): Magento\\Webapi\\Controller\\Rest\\InputParamsResolver\\Interceptor->___callPlugins('resolve', Array, Array)\n#6 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(85): Magento\\Webapi\\Controller\\Rest\\InputParamsResolver\\Interceptor->resolve()\n#7 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\\Webapi\\Controller\\Rest\\SynchronousRequestProcessor->process(Object(Magento\\Framework\\Webapi\\Rest\\Request\\Proxy))\n#8 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#9 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#10 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#11 /var/www/vhosts/store-api.silverwax.ca/httpdocs/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#12 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/App/Http.php(136): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#13 /var/www/vhosts/store-api.silverwax.ca/httpdocs/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#14 /var/www/vhosts/store-api.silverwax.ca/httpdocs/vendor/magento/framework/App/Bootstrap.php(258): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#15 /var/www/vhosts/store-api.silverwax.ca/httpdocs/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#16 {main}"
}

Error

Error
magento2-review-api + magento2-vsbridge-indexer

Updated version for Composer < 2.0

Hi, when I follow your installation instructions, I receive an error because your plugin requires composer version <2.0, but my server has 2.0 installed. It would be very costly and time consuming for me to look for a new hosting provider vs what I have now, have you put out a newer version that works with Composer version >2.0?
Thanks!

support php7.2

Is it possible to update the php package requirements to support 7.2?

review_status field vulnerability

I am not 100% sure, my statements may be wrong, but I was using this module with Vue Storefront on Frontend and passing { "review": { "review_status": 1 } } in POST review request makes review already Approved! You can also pass status Pending and Not Approved.
This opens a way to "spam" reviews without accepting them.
I was searching for any working Vue Storefornt implementation but I didn't found any with working review mechanism.
I tried to create reviews using this way for Vue Storefront demo without success.
In my personal implementation with my Magento backend there is ability to use this vulnerability.

Support php7.4

Is it possible to update the PHP package requirements to support php7.4?

support 8.2

Is it possible to update the PHP package requirements to support php 8.*?

Update README

Hello!

I tried to make a PR but i didn't have access to push my branch.
Please is it possible to update this command:
config repositories.divante vcs https://github.com/DivanteLtd/magento2-review-api.git
to
composer config repositories.divante vcs https://github.com/DivanteLtd/magento2-review-api.git
I had some complains that the command didn't work and most of the users didn't know that they need to use composer to config the repository.

Thanks!

License and adding to core

Hey guys,

This is looking good! Had a couple questions:

  1. The code references a LICENSE_DIVANTE.txt file, which doesn't seem to exist. Is this work available under an existing open source license, or is it a custom one?

  2. Any chance of this being proposed for inclusion in core? It's clearly functionality that is currently missing and would be a big benefit to everyone doing PWAs.

Keep up the great work!

Getting error of "Consumer isn't authorized to access %resources."

I'm still unable to fix this issue, getting this response while accessing api:
{
"message": "The consumer isn't authorized to access %resources.",
"parameters": {
"resources": "Magento_Review::reviews_all"
}
}

I really can't understand that how to create new Integration, would be great and thankful if someone guide me for this.

Someone, Please help me.. I don't know how to get this issue fixed.
TIA
Screenshot from 2021-07-20 16-10-15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.