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 Ticket
  • Author
    Posts
  • #518774

    Rodney Chatman
    Expired Member
    Post count: 89

    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.

    #518784

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks, the developers will take a look at your questions ASAP

    #518812

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #518876

    Kiran
    Moderator
    Post count: 7069

    Hi 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,
    Kiran

    #519315

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #519763

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #519834

    Kiran
    Moderator
    Post count: 7069

    Hi 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&[email protected]&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&[email protected]&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,
    Kiran

    #519835

    Kiran
    Moderator
    Post count: 7069

    I have also updated orderby feature for locations API. Please check endpoints mentioned at here: https://wpgeodirectory.com/support/topic/listings-search/#post-517092

    Kiran

    #520097

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #520250

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #520452

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #520562

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #520717

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #520748

    Kiran
    Moderator
    Post count: 7069

    To 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 submit

    Please try parameters used by me, just change it with your data and images.

    Let us know how it goes.

    Kiran

    #520828

    Rodney Chatman
    Expired Member
    Post count: 89

    The 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

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount