Posting review REST API
This topic contains 16 replies, has 4 voices, and was last updated by D.D 7 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
April 13, 2017 at 9:58 pm #373401
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:
But this doesn’t seem to be working. Am I missing something?
Cheers!
April 14, 2017 at 4:44 pm #373541Hi,
I flagged this for the developers, they will let you know asap.
Thanks for your patience,
April 14, 2017 at 6:24 pm #373556I have flagged this for the dev who is working on the API, he will reply on Monday.
Thanks,
Stiofan
April 17, 2017 at 6:49 am #373798Hi 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,
KiranApril 18, 2017 at 1:43 pm #374063Thanks 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.
April 18, 2017 at 2:01 pm #374068– 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,
April 18, 2017 at 2:45 pm #374076just 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…”
April 19, 2017 at 2:11 pm #374259Hi,
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.jpgPlease download development version from here: https://github.com/kprajapatii/geodir_api
Thanks,
KiranApril 26, 2017 at 9:16 pm #375627the 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?
April 27, 2017 at 6:16 am #375673> 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
April 27, 2017 at 3:26 pm #375776Ok 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!
April 27, 2017 at 7:38 pm #375822Hi,
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
May 3, 2017 at 1:44 pm #376722Thanks for the update. Is this something that will be added sometime down the line? Also is this applicable to images within comments/reviews?
May 3, 2017 at 7:38 pm #376776The 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.
June 6, 2017 at 3:59 pm #381947Hi 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.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket