Rating stars not being received when posting a review

This topic contains 17 replies, has 5 voices, and was last updated by  Jim hughes 6 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #414430

    Jim hughes
    Expired Member
    Post count: 13

    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.

    #414432

    Guust
    Moderator
    Post count: 29970

    I have flagged this for the developers to have a look later today.
    Thanks

    #414476

    Kiran
    Moderator
    Post count: 7069

    Hi 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=1

    Please see: https://wpgeodirectory.com/support/topic/posting-review-rest-api/#post-373798

    Thanks,
    Kiran

    #414496

    Jim hughes
    Expired Member
    Post count: 13

    It 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?

    #414498

    Jim hughes
    Expired Member
    Post count: 13

    It 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.

    #414503

    Kiran
    Moderator
    Post count: 7069

    Hello 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,
    Kiran

    #414504

    Jim hughes
    Expired Member
    Post count: 13

    1- 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.

    #414529

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Just double checking but do you have out API plugin installed and active?

    Stiofan

    #414531

    Jim hughes
    Expired Member
    Post count: 13

    Yes it is I use it to get places and reviews, but can’t post them.

    #414601

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    OK 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

    #414736

    Kiran
    Moderator
    Post count: 7069

    Hello 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

    #414789

    Jim hughes
    Expired Member
    Post count: 13

    The 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.

    #414794

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #414802

    Jim hughes
    Expired Member
    Post count: 13
    This reply has been marked as private.
    #414860

    Jim hughes
    Expired Member
    Post count: 13

    Have you been able to resolve the issue yet?

Viewing 15 posts - 1 through 15 (of 18 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket