review totals per author

This topic contains 5 replies, has 2 voices, and was last updated by  D.D 6 years, 11 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #380540

    D.D
    Buyer
    Post count: 199

    Hi,

    the endpoint for getting reviews done by an author “http://mydomain/wp-json/geodir/v1/reviews/?author=xxx&access_token=accesstoken” is returning an empty array for every user requested.

    Am i doing something wrong?

    also would there be a way to get total count per user (if it’s not included in the response from the endpoint)

    Cheers

    #380743

    Kiran
    Moderator
    Post count: 7069

    Hi There,

    We have fixed endpoint to get reviews by author. You can download development version from here: https://github.com/kprajapatii/geodir_api/
    After updating plugin, use same endpoint (ex: ?author=20) that you are using to get reviews for particular author.

    To get total number of records, you have to use standard WP header fields from response.
    Those header fields are:
    X-WP-Total: the total number of records.
    X-WP-TotalPages: the total number of pages.

    See more at here: https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/#pagination-parameters

    Thanks,
    Kiran

    #381792

    D.D
    Buyer
    Post count: 199

    Thanks meant to get back earlier. It works great!

    #382010

    D.D
    Buyer
    Post count: 199

    Hi,

    Back on this again. It seems that the end point requires Admin level authorization to view reviews. Essentially meaning that people who write reviews wont be able to view a list of their own reviews.

    Is there a way to get the authorization level set to “subscriber”?

    #382050

    Kiran
    Moderator
    Post count: 7069

    Hi,

    This is a default behavior by WP. Subscribers does not have permission to use “author” parameter in list comments & list reviews endpoints. Subscribers should have minimum permission level like author has.

    Now we have allowed to filter reviews if author parameter is matching to logged user id. In short subscriber can only see their own reviews by using or parameter.

    It will be available in next release, but till that you can download development version from here https://github.com/kprajapatii/geodir_api/.

    Thanks,
    Kiran

    #382158

    D.D
    Buyer
    Post count: 199

    Thanks! I’ll promote all subscribers to authors and see if that sorts out the issue.

    Cheers!

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

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

Open Support Ticket