Ratings & Reviews

APIs that accompany the Livefyre Reviews App.

Get Average Ratings in Bulk

gethttps://{networkName}.quill.fyre.co/api/v3.0/stats:ratings:averages/{hash}.json

Retrieves the average user rating for one or more Reviews Collection. Use this to display the content on an index page.

Path Parameters
namerequiredtypedescription
hashtruestring

The Base64 encoded hash of all the site-article ID pairs for which counter information should be fetched. For example: (pre-encoded) :,<...>|:,....'

Responses

200

Get Average

Example application/json
{
  "status": "ok",
  "code": 200,
  "data": {
    "333682": {
      "apitest-1400002865 ratings": {
        "default": 50
      }
    }
  }
}

Post Rating

posthttps://{networkName}.quill.fyre.co/api/v3.0/collection/{collectionId}/post/rating/

Posts a rating score to a given Ratings Collection. Users may post only one rating into a Ratings Collection. Note: The Ratings Collection type differs from the Review Collection type. Collections must exist before data may be posted to them. Use the Create Collection endpoint, and set the type to 'ratings' in the Collection Metadata to create a Ratings Collection. Also note, ratings may be added to a Collection, but may not be updated or removed.

Path Parameters
namerequiredtypedescription
collectionIdtruestring

The Collection ID to post to. (For example: 10633838.)

Query Parameters
namerequiredtypedescription
ratingtruestring

This field is a stringify-ed dictionary which contains key-value pairs of the rating dimension and corresponding value (1-100, or -1 if not voted). The 'default' dimension represents the overall rating (but is not required).

lftokentruestring

A Livefyre Authentication token for the user wishing to post content into the Collection. This is returned from the Auth endpoint.

Responses

200

Post Rating

Example application/json
{
  "status": "ok",
  "code": 200,
  "data": {
    "ratings": {
      "default": 50
    },
    "author": "system@client-solutions.fyre.co"
  }
}

Ratings Summary

gethttps://{networkName}.bootstrap.fyre.co/api/v3.0/site/{siteId}/article/{b64articleId}/stats.ratings.distributions/

Retrieves a breakdown of all ratings for a specific Reviews Collection and allows you to display the number of reviews that are associated with each star rating.

Path Parameters
namerequiredtypedescription
b64articleIdtruestring

The article ID you chose to uniquely identify a collection within your Site, encoded using Base64.

siteIdtruestring

The Livefyre-provided ID for the website or application to which the Collection belongs. For example: 303617.

Query Parameters
namerequiredtypedescription
numQuantilestruenumber

The number of buckets (or quantiles) to split the ratings into. Buckets typically go up to 100, but if you would like to see a distribution across a range of numbers, you can decrease that number (to 10 or 20, for instance), and the data will be returned accordingly.

Responses

200

Ratings Breakdown

Example application/json
{
  "status": "ok",
  "code": 200,
  "data": {
    "default": {
      "average": 50,
      "distribution": [
        0,
        0,
        1,
        0,
        0
      ]
    }
  }
}

User Reviews

gethttps://{networkName}.bootstrap.fyre.co/api/v3.1/author/{user}/ratings/

Retrieves the most recent reviews for a specific user. Use this API to display a user’s reviews on their public profile page.

Path Parameters
namerequiredtypedescription
usertruestring

The ID of the user to get ratings for.

Responses

200

User Reviews

Example application/json
{
  "content": [
    {
      "source": 5,
      "content": {
        "parentId": "",
        "bodyHtml": "<p>moo</p>",
        "id": "5938077",
        "authorId": "_up1792682@livefyre.com",
        "updatedAt": 1369261425,
        "annotations": {
          "ratings": {
            "default": 94
          },
          "upvotes": 7,
          "downvotes": 11,
          "replies": 1
        },
        "createdAt": 1369261425
      },
      "collection": {
        "id": "1234",
        "articleId": "article1234",
        "url": "http://mysite.com/article",
        "title": "My Article"
      },
      "vis": 1,
      "type": 0
    }
  ],
  "authors": {
    "_up1792682@livefyre.com": {
      "displayName": "Blackjam",
      "tags": [],
      "profileUrl": "http://www.livefyre.com/profile/10460503/",
      "avatar": "http://avatars.fyre.co/a/1/bffd863c1c0d024033479b4d1eb34cfe/50.jpg",
      "type": 1,
      "id": "_up10460503@livefyre.com"
    }
  }
}