Rating stars not being received when posting a review
This topic contains 17 replies, has 5 voices, and was last updated by Jim hughes 7 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: api
-
AuthorPosts
-
January 25, 2018 at 9:02 pm #414430
I tried to make a comment on a post using the method described in this link, and the comment is being posted successfully, but the rating stars are not received in the comment. I am using this route: http://site-name.com/wp-json/wp/v2/comments in a POST request with the parameters: post for the post id, content for the comment, and tried overall_rating and rating[overall] but both aren’t working to send the rating.
January 25, 2018 at 10:27 pm #414432I have flagged this for the developers to have a look later today.
ThanksJanuary 26, 2018 at 11:03 am #414476Hi Jim,
It seems you are using WP standard comments endpoint (/wp-json/wp/v2/comments) to submit the review. We have our own endpoint to submit the review (/wp-json/geodir/v1/reviews/)
Example url to submit review:
https://mydomain.com/wp-json/geodir/v1/reviews/?post=48&content=This is a review with 5 stars via API&rating[overall]=5&author=1Please see: https://wpgeodirectory.com/support/topic/posting-review-rest-api/#post-373798
Thanks,
KiranJanuary 26, 2018 at 12:39 pm #414496It is returning 403 Forbidden http response:
{
“code”: “rest_comment_invalid_post_id”,
“message”: “Sorry, you are not allowed to create this comment without a post.”,
“data”: {
“status”: 403
}
}Though I checked the post id is valid and it is the same one I used when I made a comment using the wordpress endpoint. How can I get over this problem?
January 26, 2018 at 12:49 pm #414498It works when I make it as a GET request with the same URL you pasted, but it doesn’t appear in the comments on the website though the response is 200 OK. On the other hand, the POST request doesn’t work though it is shown as an endpoint in the /wp-json/ reply.
January 26, 2018 at 1:15 pm #414503Hello Jim,
Sorry, you are not allowed to create this comment without a post.
Make sure you have valid post ID value applied for “&post=”.
It doesn’t appear in the comments on the website though the response is 200 OK.
Which status you have applied to the comment? Unapproved comments may not be retrieved in comments response.
the POST request doesn’t work though it is shown as an endpoint in the /wp-json/ reply.
How you are sending POST request to submit review?
Thanks,
KiranJanuary 26, 2018 at 1:28 pm #4145041- I am not sending a status but the comment is not even appearing in the unaproved section in wordprss dashboard
2- I am sending the post request with the same parameters as the get but in the body and the authorization header.
January 26, 2018 at 6:33 pm #414529Just double checking but do you have out API plugin installed and active?
Stiofan
January 26, 2018 at 7:15 pm #414531Yes it is I use it to get places and reviews, but can’t post them.
January 27, 2018 at 11:21 am #414601OK thanks for confirming.
I’ll let Kiran answer this topic on Monday as he was the one that built the api.For future reference the add listing process via api will be much easier in GDv2.
Thanks,
Stiofan
January 29, 2018 at 5:00 am #414736Hello Jim,
Please provide us admin & FTP credentials so i can look into there.
You can check this topic, it may help you https://wpgeodirectory.com/support/topic/geo-api-post/page/2/#post-343451
Kiran
January 29, 2018 at 10:49 am #414789The topic didn’t help. The response of the GET request of posting the comment is 200 OK but the comments don’t appear. So I think the problem is somewhere in the plugin.
January 29, 2018 at 11:36 am #414794This reply has been marked as private.January 29, 2018 at 12:19 pm #414802This reply has been marked as private.January 29, 2018 at 7:47 pm #414860Have you been able to resolve the issue yet?
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket