Review Api for magento 2.1.12How to display individual rating summary?How to Create product rating programmatically?Disable Product Reviews but keep rating enabledDynamically accepted the Reviews and RatingMagento get reviews filtered by productreview form not showing - update: it was ebizmarts magemonkey!Magento 2: Message displays After disable Product Review Module “Attention: Something went wrong”Magento 2 Add review form on custom pageReview/Rating Spam Protection in Magento 2Magento 2.1 Changing review list position in product page
Does Shadow Sorcerer's Eyes of the Dark work on all magical darkness or just his/hers?
Exposing a company lying about themselves in a tightly knit industry: Is my career at risk on the long run?
10 year ban after applying for a UK student visa
What are rules for concealing thieves tools (or items in general)?
Friend wants my recommendation but I don't want to
The English Debate
What is the difference between something being completely legal and being completely decriminalized?
What is the tangent at a sharp point on a curve?
Why is participating in the European Parliamentary elections used as a threat?
Do people actually use the word "kaputt" in conversation?
Would this string work as string?
Print last inputted byte
Writing in a Christian voice
How to balance a monster modification (zombie)?
How can I query the supported timezones in Apex?
How are passwords stolen from companies if they only store hashes?
Error in master's thesis, I do not know what to do
Jem'Hadar, something strange about their life expectancy
How to remove space in section title at KOMA-Script
When should a starting writer get his own webpage?
Would it be believable to defy demographics in a story?
Do native speakers use "ultima" and "proxima" frequently in spoken English?
How do you justify more code being written by following clean code practices?
Do I need to convey a moral for each of my blog post?
Review Api for magento 2.1.12
How to display individual rating summary?How to Create product rating programmatically?Disable Product Reviews but keep rating enabledDynamically accepted the Reviews and RatingMagento get reviews filtered by productreview form not showing - update: it was ebizmarts magemonkey!Magento 2: Message displays After disable Product Review Module “Attention: Something went wrong”Magento 2 Add review form on custom pageReview/Rating Spam Protection in Magento 2Magento 2.1 Changing review list position in product page
I have successfully install this module Reviews/Rating
I call this url="/V1/review/mine/post" method="POST".I don't know what data is passed in body of this URL.
magento-2.1 review rest-api
add a comment |
I have successfully install this module Reviews/Rating
I call this url="/V1/review/mine/post" method="POST".I don't know what data is passed in body of this URL.
magento-2.1 review rest-api
can you share all the files of your program
– shweta
11 hours ago
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
– Manashvi Birla
10 hours ago
add a comment |
I have successfully install this module Reviews/Rating
I call this url="/V1/review/mine/post" method="POST".I don't know what data is passed in body of this URL.
magento-2.1 review rest-api
I have successfully install this module Reviews/Rating
I call this url="/V1/review/mine/post" method="POST".I don't know what data is passed in body of this URL.
magento-2.1 review rest-api
magento-2.1 review rest-api
edited May 10 '18 at 7:46
Vishwas Bhatnagar
2,88122045
2,88122045
asked May 10 '18 at 7:28
Lovely SetiaLovely Setia
113
113
can you share all the files of your program
– shweta
11 hours ago
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
– Manashvi Birla
10 hours ago
add a comment |
can you share all the files of your program
– shweta
11 hours ago
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
– Manashvi Birla
10 hours ago
can you share all the files of your program
– shweta
11 hours ago
can you share all the files of your program
– shweta
11 hours ago
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
– Manashvi Birla
10 hours ago
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
– Manashvi Birla
10 hours ago
add a comment |
1 Answer
1
active
oldest
votes
If you inspect the module code etc/webapi.xml you will see following code
<route url="/V1/review/mine/post" method="POST">
<service class="IpragmatechIpreviewApiReviewInterface" method="writeReviews"/>
<resources>
<resource ref="self" />
</resources>
<data>
<parameter name="customer_id" force="true">%customer_id%</parameter>
</data>
</route>
And API signature in IpreviewApiReviewInterface
/**
* Added review and rating for the product.
* @param int $productId
* @param string $title
* @param string $nickname
* @param string $detail
* @param IpragmatechIpreviewApiDataRatingInterface[] $ratingData
* @param int $customer_id
* @param int $store_id
* @return boolean
*
*/
public function writeReviews(
$productId,
$nickname,
$title,
$detail,
$ratingData,
$customer_id = null,
$storeId
);
So whenever you are setting ref as self the data will be taken from the token passed as bearer token and data node below it specify which data has to be taken form the the token . In above case it is customer ID , it also can be token .
$customer_id will be taken from token and rest of the params can be passed in below body format
"productId": "10",
"nickname": "Mann",
"title": "Cool, Nice product",
"detail": "This is nice product. I recommended this product.",
"ratingData": [
"rating_id": "3",
"ratingCode": "price",
"ratingValue": "5"
,
"rating_id": "4",
"ratingCode": "Rating",
"ratingValue": "2"
],
"storeId": "1"
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTOrating_option_vote(option_id,review_id,percent,value,remote_ip,remote_ip_long,customer_id,entity_pk_value,rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].
– Lovely Setia
May 10 '18 at 8:15
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f225443%2freview-api-for-magento-2-1-12%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you inspect the module code etc/webapi.xml you will see following code
<route url="/V1/review/mine/post" method="POST">
<service class="IpragmatechIpreviewApiReviewInterface" method="writeReviews"/>
<resources>
<resource ref="self" />
</resources>
<data>
<parameter name="customer_id" force="true">%customer_id%</parameter>
</data>
</route>
And API signature in IpreviewApiReviewInterface
/**
* Added review and rating for the product.
* @param int $productId
* @param string $title
* @param string $nickname
* @param string $detail
* @param IpragmatechIpreviewApiDataRatingInterface[] $ratingData
* @param int $customer_id
* @param int $store_id
* @return boolean
*
*/
public function writeReviews(
$productId,
$nickname,
$title,
$detail,
$ratingData,
$customer_id = null,
$storeId
);
So whenever you are setting ref as self the data will be taken from the token passed as bearer token and data node below it specify which data has to be taken form the the token . In above case it is customer ID , it also can be token .
$customer_id will be taken from token and rest of the params can be passed in below body format
"productId": "10",
"nickname": "Mann",
"title": "Cool, Nice product",
"detail": "This is nice product. I recommended this product.",
"ratingData": [
"rating_id": "3",
"ratingCode": "price",
"ratingValue": "5"
,
"rating_id": "4",
"ratingCode": "Rating",
"ratingValue": "2"
],
"storeId": "1"
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTOrating_option_vote(option_id,review_id,percent,value,remote_ip,remote_ip_long,customer_id,entity_pk_value,rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].
– Lovely Setia
May 10 '18 at 8:15
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
add a comment |
If you inspect the module code etc/webapi.xml you will see following code
<route url="/V1/review/mine/post" method="POST">
<service class="IpragmatechIpreviewApiReviewInterface" method="writeReviews"/>
<resources>
<resource ref="self" />
</resources>
<data>
<parameter name="customer_id" force="true">%customer_id%</parameter>
</data>
</route>
And API signature in IpreviewApiReviewInterface
/**
* Added review and rating for the product.
* @param int $productId
* @param string $title
* @param string $nickname
* @param string $detail
* @param IpragmatechIpreviewApiDataRatingInterface[] $ratingData
* @param int $customer_id
* @param int $store_id
* @return boolean
*
*/
public function writeReviews(
$productId,
$nickname,
$title,
$detail,
$ratingData,
$customer_id = null,
$storeId
);
So whenever you are setting ref as self the data will be taken from the token passed as bearer token and data node below it specify which data has to be taken form the the token . In above case it is customer ID , it also can be token .
$customer_id will be taken from token and rest of the params can be passed in below body format
"productId": "10",
"nickname": "Mann",
"title": "Cool, Nice product",
"detail": "This is nice product. I recommended this product.",
"ratingData": [
"rating_id": "3",
"ratingCode": "price",
"ratingValue": "5"
,
"rating_id": "4",
"ratingCode": "Rating",
"ratingValue": "2"
],
"storeId": "1"
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTOrating_option_vote(option_id,review_id,percent,value,remote_ip,remote_ip_long,customer_id,entity_pk_value,rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].
– Lovely Setia
May 10 '18 at 8:15
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
add a comment |
If you inspect the module code etc/webapi.xml you will see following code
<route url="/V1/review/mine/post" method="POST">
<service class="IpragmatechIpreviewApiReviewInterface" method="writeReviews"/>
<resources>
<resource ref="self" />
</resources>
<data>
<parameter name="customer_id" force="true">%customer_id%</parameter>
</data>
</route>
And API signature in IpreviewApiReviewInterface
/**
* Added review and rating for the product.
* @param int $productId
* @param string $title
* @param string $nickname
* @param string $detail
* @param IpragmatechIpreviewApiDataRatingInterface[] $ratingData
* @param int $customer_id
* @param int $store_id
* @return boolean
*
*/
public function writeReviews(
$productId,
$nickname,
$title,
$detail,
$ratingData,
$customer_id = null,
$storeId
);
So whenever you are setting ref as self the data will be taken from the token passed as bearer token and data node below it specify which data has to be taken form the the token . In above case it is customer ID , it also can be token .
$customer_id will be taken from token and rest of the params can be passed in below body format
"productId": "10",
"nickname": "Mann",
"title": "Cool, Nice product",
"detail": "This is nice product. I recommended this product.",
"ratingData": [
"rating_id": "3",
"ratingCode": "price",
"ratingValue": "5"
,
"rating_id": "4",
"ratingCode": "Rating",
"ratingValue": "2"
],
"storeId": "1"
If you inspect the module code etc/webapi.xml you will see following code
<route url="/V1/review/mine/post" method="POST">
<service class="IpragmatechIpreviewApiReviewInterface" method="writeReviews"/>
<resources>
<resource ref="self" />
</resources>
<data>
<parameter name="customer_id" force="true">%customer_id%</parameter>
</data>
</route>
And API signature in IpreviewApiReviewInterface
/**
* Added review and rating for the product.
* @param int $productId
* @param string $title
* @param string $nickname
* @param string $detail
* @param IpragmatechIpreviewApiDataRatingInterface[] $ratingData
* @param int $customer_id
* @param int $store_id
* @return boolean
*
*/
public function writeReviews(
$productId,
$nickname,
$title,
$detail,
$ratingData,
$customer_id = null,
$storeId
);
So whenever you are setting ref as self the data will be taken from the token passed as bearer token and data node below it specify which data has to be taken form the the token . In above case it is customer ID , it also can be token .
$customer_id will be taken from token and rest of the params can be passed in below body format
"productId": "10",
"nickname": "Mann",
"title": "Cool, Nice product",
"detail": "This is nice product. I recommended this product.",
"ratingData": [
"rating_id": "3",
"ratingCode": "price",
"ratingValue": "5"
,
"rating_id": "4",
"ratingCode": "Rating",
"ratingValue": "2"
],
"storeId": "1"
edited May 10 '18 at 8:59
answered May 10 '18 at 7:42
Vishwas BhatnagarVishwas Bhatnagar
2,88122045
2,88122045
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTOrating_option_vote(option_id,review_id,percent,value,remote_ip,remote_ip_long,customer_id,entity_pk_value,rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].
– Lovely Setia
May 10 '18 at 8:15
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
add a comment |
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTOrating_option_vote(option_id,review_id,percent,value,remote_ip,remote_ip_long,customer_id,entity_pk_value,rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].
– Lovely Setia
May 10 '18 at 8:15
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTO
rating_option_vote (option_id, review_id, percent, value, remote_ip, remote_ip_long, customer_id, entity_pk_value, rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].– Lovely Setia
May 10 '18 at 8:15
I will pass this data as following: "productId":"8","nickname":"lovely","title":"Nice Product","detail":"This is nice product","ratingData":["ratingValue":"2"],"storeId":"1".But its showing error :["status":false,"message":"We can't post your review right now. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'value' cannot be null, query was: INSERT INTO
rating_option_vote (option_id, review_id, percent, value, remote_ip, remote_ip_long, customer_id, entity_pk_value, rating_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"].– Lovely Setia
May 10 '18 at 8:15
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
@LovelySetia updated the answer , Please accept the answer if it works for you
– Vishwas Bhatnagar
May 10 '18 at 8:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
Please upvote and accept that answer please
– Vishwas Bhatnagar
May 10 '18 at 10:59
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
it is throwing the same error for me too, what code changes needs to be done?
– sahana
Sep 26 '18 at 5:51
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f225443%2freview-api-for-magento-2-1-12%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
can you share all the files of your program
– shweta
11 hours ago
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
– Manashvi Birla
10 hours ago