API Reviews Endpoint Issue

This topic contains 4 replies, has 3 voices, and was last updated by  Kiran 6 years, 11 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #381829

    D.D
    Buyer
    Post count: 199

    Hi,

    The Geodirectory theme I use (whoop) has a feature where listing owners can respond to reviews posted to their listings.

    On the back end, I can see see owner review responses in the comments section and not the Geodirectory->Reviews tab (which is correct since it’s a response”comment” and not a review).

    However, the endpoint for the “mydomain.com/wp-json/geodir/v1/reviews” pulls the responses in with most of the fields set to “null”. Is there a way to get rid of these so that they don’t show up with reviews?

    It’s fine if they show up under the regular WordPress comments endpoint call.

    Thanks.

    #381938

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    Kiran has been alerted and he’ll let you know asap.

    Thanks

    #382038

    Kiran
    Moderator
    Post count: 7069

    Hi D.D,

    BTW you can differentiate reviews & responses with the use of “overall_rating” field. For reviews overall_rating has any integer value (rating stars) & for response it has null value.

    Let us provide the endpoint url that shows reviews & responses both.

    Thanks,
    Kiran

    #382184

    D.D
    Buyer
    Post count: 199

    Are you saying download the JSON and then filter the results?

    #382240

    Kiran
    Moderator
    Post count: 7069

    Before displaying review, with the use of overall_rating value you can decide whether to display or not. Means if overall_rating is not null then it is review so display it and if overall_rating is null then it is response, so don’t display it.

    To get reviews list this is the only endpoint so we need here both reviews & reply to be retrieved.

    Kiran

Viewing 5 posts - 1 through 5 (of 5 total)

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

Open Support Ticket