Posting review REST API

This topic contains 16 replies, has 4 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
  • #373401

    D.D
    Buyer
    Post count: 199

    Hi,

    I’m using the REST API with OAuth2.0. I’m able to get the access token but unable to post test comments. So far i’m using the the scheme:

    https://mydomain.com/wp-json/geodir/v1/reviews/?post=1111&overall_rating=2&review=reviewcontent&access_token=reveivedtoken

    But this doesn’t seem to be working. Am I missing something?

    Cheers!

    #373541

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I flagged this for the developers, they will let you know asap.

    Thanks for your patience,

    #373556

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I have flagged this for the dev who is working on the API, he will reply on Monday.

    Thanks,

    Stiofan

    #373798

    Kiran
    Moderator
    Post count: 7069

    Hi D.D

    Let me know what you get in response of API request after submitting review.

    We are using WP standard method to submit comment/review just like here https://developer.wordpress.org/rest-api/reference/comments/#create-a-comment
    You just need to pass rating stars here with parameter “&rating[overall]=5”.

    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 try to submit comment on any post via WP API route “https://mydomain.com/wp-json/wp/v2/comments/” and see what you get in the response.

    Here some info how to use Auth plugin https://wpgeodirectory.com/support/topic/geo-api-post/page/2/#post-341957

    thanks,
    Kiran

    #374063

    D.D
    Buyer
    Post count: 199

    Thanks for the update Kiran.

    I was able to successfully post using “https://mydomain.com/wp-json/wp/v2/comments” with the parameters and access token.

    I do have two observations;

    – The newly created comments/reviews do not show up in the activity page/widget for the site.
    – The owner of the listing does not get an email when a comment/review is made via the REST API.

    I don’t know whether these are WP REST API issues or not so any explanation would be helpful.

    Cheers.

    #374068

    Kiran
    Moderator
    Post count: 7069

    – The newly created comments/reviews do not show up in the activity page/widget for the site.
    <
    Make sure you have passed correct parameter and values as explained here https://developer.wordpress.org/rest-api/reference/comments/#create-a-comment
    Comment status must be not pending/draft for submitted comment.

    – The owner of the listing does not get an email when a comment/review is made via the REST API.
    <
    May be WP doesn’t send notification email on comment via REST API. You can confirm it via submitting comment for standard post via https://mydomain.com/wp-json/wp/v2/comments/

    Thanks,

    #374076

    D.D
    Buyer
    Post count: 199

    just to clarify,

    The comments show up in the in the comments page on the back end, the “geo-directory review” page as well as the in the comments section of the actual post. Those are great but some reason the same comment doesn’t show up in the activities page and the recent activity widget.

    I’ll try out the standard post as suggested.

    One more question. What route/endpoints should I use for uploading images to an existing listing? using “https://mydomain.com/wp-json/geodir/v1/places…”

    #374259

    Kiran
    Moderator
    Post count: 7069

    Hi,

    I have added schema for post images.

    The route/endpoint for update listing is https://mydomain.com/wp-json/geodir/v1/places/PLACE_ID/
    Ex: https://mydomain.com/wp-json/geodir/v1/places/110/?title=my listing…….

    Listing images added via post_images parameter with comma separated for list of images.
    Ex: https://mydomain.com/wp-json/geodir/v1/places/110/?title=my listing&post_images=http://yoursite.com/wp-content/uploads/2016/12/psk.jpg,http://yoursite.com/wp-content/uploads/2016/12/psb2.jpg

    Please download development version from here: https://github.com/kprajapatii/geodir_api

    Thanks,
    Kiran

    #375627

    D.D
    Buyer
    Post count: 199

    the title field would be the title for the image or would that be the title for the listing?

    Would the listing title be updated to whatever value is passed through the “title” parameter?

    #375673

    Kiran
    Moderator
    Post count: 7069

    > the title field would be the title for the image or would that be the title for the listing?
    <
    The title is for the listing. The route/endpoint provided is used for edit the listing. There is no separate route/endpoint to upload listing images. You can upload images for listing via add/edit listing route.

    > Would the listing title be updated to whatever value is passed through the “title” parameter?
    < Yes, it will update the listing title. This is like you are submitting listing form during update listing.

    Kiran

    #375776

    D.D
    Buyer
    Post count: 199

    Ok thanks.

    Users are able to add photos to existing listings that they do not own on the platform under the “Add Photo” tab.

    This tab is independent of the add/edit tab and the URL looks like “https://mydomain.com/places/city/category/title/?add_biz_photo=1”. Is there a way to get a route specifically for this so that users can still upload images to a listing whether they own it or not?

    Cheers!

    #375822

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    Users are able to add photos to existing listings that they do not own on the platform under the “Add Photo” tab.

    This would be a feature of Whoop, not GeoDirectory, so there is no similar thing in the API.

    Thanks

    #376722

    D.D
    Buyer
    Post count: 199

    Thanks for the update. Is this something that will be added sometime down the line? Also is this applicable to images within comments/reviews?

    #376776

    Paolo
    Site Admin
    Post count: 31206

    The API is for GeoDirectory, not for themes specific features, so unless we add a similar feature to GD itself, which is not in future plans, I don’t think this’ll ever make it into the API.

    For images in comments it is much more probable, but I can’t promise anything right now.

    #381947

    D.D
    Buyer
    Post count: 199

    Hi Kiran,

    I came across this while looking for solutions to the new comments not triggering emails to the listing owner

    https://wordpress.org/support/topic/wp-api-comments-not-sending-notifications/#post-8987973

    would it be possible to integrate this into the geodirectory REST API?

    Cheers.

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

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

Open Support Ticket