Rating numbers not being received via API.
This topic contains 17 replies, has 3 voices, and was last updated by Kiran 4 years, 11 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: rest api, submit review
-
AuthorPosts
-
November 26, 2019 at 6:22 pm #518774
Hello,
I’m having an issue similar to https://wpgeodirectory.com/support/topic/rating-stars-not-being-received-when-posting-a-review/. I can add reviews to listings via the API but the rating numbers aren’t showing.
/wp-json/geodir/v2/reviews/?post=26348&author=2&content=This is a 4 star rating test.&rating[overall]=4
I would also like for users to be able to add photos to their ratings/reviews.
November 26, 2019 at 7:09 pm #518784Thanks, the developers will take a look at your questions ASAP
November 27, 2019 at 3:16 am #518812This reply has been marked as private.November 27, 2019 at 2:06 pm #518876Hi Rodney,
This has been fixed and it will be in next release of GeoDirectory & Review Rating Manager plugin.
Provide us FTP credentials if you want me to apply patch on your site.
Regards,
KiranNovember 30, 2019 at 9:47 pm #519315This reply has been marked as private.December 3, 2019 at 5:47 pm #519763This reply has been marked as private.December 4, 2019 at 7:52 am #519834Hi Rodney,
I have applied patch on your site.
To submit reviews via REST API use following endpoints.
1) NORMAL RATING:
1.1) Using basic data:
?post=801&content=This is comment via API&rating=5
1.2) Using advance data:
?author=1&author_email=thisismyemailaddress@gmail.com&author_ip=127.0.0.1&author_name=Test User&author_url=https://www.google.co.in&status=1&post=801&content=This is comment via API&rating=5&images=http://www.mysite.com/images/1.png::http://www.mysite.com/images/2.png
2) MULTI RATINGS:
2.1) Using basic data:
?post=801&content=This is comment via API&rating=5&ratings[3]=3&ratings[4]=5
2.2) Using advance data:
?author=1&author_email=thisismyemailaddress@gmail.com&author_ip=127.0.0.1&author_name=Test User&author_url=https://www.google.co.in&status=1&post=801&content=This is comment via API&rating=5&ratings[3]=3&ratings[4]=3&images=http://www.mysite.com/images/1.png::http://www.mysite.com/images/2.png
NOTE: In ratings[3] & ratings[4] 3 & 4 are rating ids.
RESPONSE:
{ "id": 242, "post": 801, "parent": 0, "author": 1, "author_name": "Admin", "author_url": "http://www.mysite.com/", "date": "2019-11-23T13:24:52", "date_gmt": "2019-11-23T13:24:52", "content": { "rendered": "<div class=\"description\"><p>This is comment via API</p>\n</div>" }, "link": "http://www.mysite.com/places/australia/new-south-wales/sydney/festival/the-test/#comment-242", "status": "approved", "type": "comment", "post_type": "gd_place", "country": "Australia", "region": "New South Wales", "city": "Sydney", "latitude": "-33.8748058817", "longitude": "151.2082655317", "rating": { "id": "overall", "label": "Overall", "rating": 5, "html": "<div class=\"gd-rating-outer-wrap gd-rating-output-wrap\">\t\t<div class=\"gd-rating gd-rating-output gd-rating-type-font-awesome\">\r\n\t\t\t<span class=\"gd-rating-wrap\" title=\"5 star rating\">\r\n\t\t\t\t<span class=\"gd-rating-foreground\" style='width:100%; '>\r\n\t\t\t\t<i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i>\t\t\t\t</span>\r\n\t\t\t\t<span class=\"gd-rating-background\" >\r\n\t\t\t\t<i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i>\t\t\t\t</span>\r\n\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t</div>" }, "ratings": { "rendered": { "3": { "id": 3, "label": "Service", "rating": 3, "max_rating": 5, "html": "<div class=\"gd-rating-outer-wrap gd-rating-output-wrap\">\t\t<div class=\"gd-rating gd-rating-output gd-rating-type-font-awesome\">\r\n\t\t\t<span class=\"gd-rating-wrap\" title=\"3 star rating\">\r\n\t\t\t\t<span class=\"gd-rating-foreground\" style='width:60%; '>\r\n\t\t\t\t<i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i>\t\t\t\t</span>\r\n\t\t\t\t<span class=\"gd-rating-background\" >\r\n\t\t\t\t<i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-star fa-fw\" aria-hidden=\"true\" ></i>\t\t\t\t</span>\r\n\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t</div>" }, "4": { "id": 4, "label": "Price", "rating": 3, "max_rating": 3, "html": "<div class=\"gd-rating-outer-wrap gd-rating-output-wrap\">\t\t<div class=\"gd-rating gd-rating-output gd-rating-type-font-awesome\">\r\n\t\t\t<span class=\"gd-rating-wrap\" title=\"3 star rating\">\r\n\t\t\t\t<span class=\"gd-rating-foreground\" style='width:100%; color:#001ae5; '>\r\n\t\t\t\t<i class=\"fas fa-rupee-sign fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-rupee-sign fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-rupee-sign fa-fw\" aria-hidden=\"true\" ></i>\t\t\t\t</span>\r\n\t\t\t\t<span class=\"gd-rating-background\" >\r\n\t\t\t\t<i class=\"fas fa-rupee-sign fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-rupee-sign fa-fw\" aria-hidden=\"true\" ></i><i class=\"fas fa-rupee-sign fa-fw\" aria-hidden=\"true\" ></i>\t\t\t\t</span>\r\n\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t</div>" } } }, "images": { "rendered": [ { "id": "961", "title": "", "src": "http://www.mysite.com/wp-content/uploads/2019/11/2-7.png", "thumbnail": "http://www.mysite.com/wp-content/uploads/2019/11/2-7-150x150.png", "featured": false, "position": "1" }, { "id": "960", "title": "", "src": "http://www.mysite.com/wp-content/uploads/2019/11/1-7.png", "thumbnail": "http://www.mysite.com/wp-content/uploads/2019/11/1-7.png", "featured": true, "position": "0" } ] }, "total_images": 2, "likes": 0, "author_avatar_urls": { "24": "http://www.mysite.com/wp-content/plugins/userswp/assets/images/no_profile.png", "48": "http://www.mysite.com/wp-content/plugins/userswp/assets/images/no_profile.png", "96": "http://www.mysite.com/wp-content/plugins/userswp/assets/images/no_profile.png" }, "meta": [], "_links": { "self": [ { "href": "http://www.mysite.com/wp-json/geodir/v2/reviews/242" } ], "collection": [ { "href": "http://www.mysite.com/wp-json/geodir/v2/reviews" } ], "author": [ { "embeddable": true, "href": "http://www.mysite.com/wp-json/wp/v2/users/1" } ], "up": [ { "embeddable": true, "post_type": "gd_place", "href": "http://www.mysite.com/wp-json/geodir/v2/places/801" } ] } }
Regards,
KiranDecember 4, 2019 at 7:59 am #519835I have also updated orderby feature for locations API. Please check endpoints mentioned at here: https://wpgeodirectory.com/support/topic/listings-search/#post-517092
Kiran
December 5, 2019 at 2:58 pm #520097This reply has been marked as private.December 6, 2019 at 10:59 am #520250This reply has been marked as private.December 7, 2019 at 10:36 pm #520452This reply has been marked as private.December 9, 2019 at 5:42 am #520562This reply has been marked as private.December 9, 2019 at 9:26 pm #520717This reply has been marked as private.December 10, 2019 at 6:08 am #520748To test REST API post request try this plugin https://wordpress.org/plugins/rest-api-console/
– Install & activate plugin
– Go Tools > REST API > Select xxx/wp-json/geodir/v2/reviews/ POST
– Add parameter and submitPlease try parameters used by me, just change it with your data and images.
Let us know how it goes.
Kiran
December 10, 2019 at 5:43 pm #520828The issue I’m having is understanding how the actual image file relates to the string in the POST query. The image file is MultiPart Body. I can’t seem to make the connection between that and the string URL in the post. I know I’m close to going outside the scope of support but I’m desperate? LOL
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket