Support » Plugin: WP Job Manager » Ratings Categories for creating reviews with REST API

  • Resolved tuzmusic

    (@tuzmusic)


    I’m trying to use the JSON REST API plugin to create reviews on my listings from my mobile app. I’ve sent a GET request to /respond/submit_comment/ with the params: post_id, name, email, content, rating.

    I’m getting an HTML response that says ERROR: Please select a rating for all categories.

    How do I do this? In my WP Dashboard > Listings > Settings > Reviews, the single review category listed is simply ” Your Rating ” – and you can’t tell from the way that renders here but there’s maybe a dozen spaces on either side of that text.

    I imagine that using the JSON REST API plugin is sort of a back-door way to do this, so let me know if I need to do something in the server code to make this work.

    Thank you.

    • This topic was modified 2 months, 1 week ago by  tuzmusic.
Viewing 3 replies - 1 through 3 (of 3 total)
  • This question would be better suited for the Reviews addon that you’re using, as this isn’t related to WP Job Manager, but related to that addon plugin you’re using.

    BUT .. since I know this plugin I will still try to help. First — my guess is you’re just assuming that rating is the field to submit the rating in — but it’s not, they are processed as star-rating-X where X is replaced by the index of the category rating, top down starts at 0.

    The plugin also expects the request to be a POST not a GET request … now this is how it is handled standard on the frontend .. how this is translated to REST API — i do not know.

    I do know that comment meta used is review_stars and review_average — and the meta on the listing itself is _all_ratings

    • This reply was modified 2 months, 1 week ago by  tripflex.
    tuzmusic

    (@tuzmusic)

    Thanks a lot @tripflex. I’ll definitely find the support section for that add-on.
    My GET request was actually calling from the JSON API, which for some reason uses all GETs, although if I switch my request to POST, it gives the same result.

    I tried star-rating-0 which gave me the same result as before. But I also noticed that I get that result if I don’t try to submit any rating whatsoever, so it’s possible that none of these options are getting through correctly at all (i.e., it’s not telling me “You gave me one rating, but I need more!” but rather “I need ratings!”)

    I’ll check out the Reviews forum!

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Since this isn’t a WPJM question, I’m going to mark it as resolved. Hope you find the solution!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.