The REST API Add-On allows developers to access ratings data through an easy-to-use HTTP REST API. 11 readonly REST endpoints are made available and a new REST field called “mutli-rating-pro” is also registered for applicable post objects.

Requires WordPress > 4.7 and Multi Rating Pro > 5.2.5.

Documentation on the WordPress REST API v2 can be found here.

Settings

The REST endpoints and fields can be enabled via the plugin settings and whether user data such as user id, e-mail and username shall be returned with rating entry data.

REST Endpoints

Note: Further documentation on REST endpoint parameters can be found from the equivalent shortcodes or template tags.

Route Methods Description Parameters Example Request
/mrp/v1/rating-entries GET Returns a list of rating entries. taxonomy, term_id, limit, rating_form_id, sort_by, post_id, rating_item_ids, user_roles, rating_entry_ids, user_id, to_date, from_date, offset, post_ids, entry_status, approved_comments_only and published_posts_only $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-entries?post_id=1
/mrp/v1/rating-entries/(?P[\d]+) GET Returns a single rating entry given a rarting entry id. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-entries/1
/mrp/v1/rating-forms GET Returns a list of rating forms. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-forms
/mrp/v1/rating-forms/(?P[\d]+) GET Returns a single rating form given a rating form id. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-forms/1
/mrp/v1/rating-items GET Returns a list of rating items. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-items
/mrp/v1/rating-items/(?P[\d]+) GET Returns a single rating item given a rating item id. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-items/1
/mrp/v1/rating-results GET Returns a list of rating results. taxonomy, term_id, limit, rating_form_id, sort_by, rating_item_ids, user_roles, rating_entry_ids, to_date, from_date, offset, post_ids, entry_status, approved_comments_only, published_posts_only, post_id, user_id and comments_only $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-results
/mrp/v1/rating-item-results GET Returns a list of rating item results. rating_form_id, post_id, rating_item_ids, user_roles, rating_entry_ids, entry_status, to_date, from_date, comments_only, taxonomy, term_id, post_ids and sort_by $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-item-results
/mrp/v1/rating-item-results/(?P[\d]+) GET Returns a single rating item result given an rating item id. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/rating-item-results/1
/mrp/v1/custom-fields GET Returns a list of custom fields. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/custom-fields
/mrp/v1/custom-fields/(?P[\d]+) GET Returns a single custom field given a custom field id. $ curl -X OPTIONS -i http://multiratingpro.com/wp-json/mrp/v1/custom-fields/1

JSON Objects