APIs that accompany the Livefyre Reviews App.
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.
name | required | type | description |
---|---|---|---|
hash | true | string | The Base64 encoded hash of all the site-article ID pairs for which counter information should be fetched. For example: (pre-encoded) |
Get Average
property | type | description |
---|---|---|
status | string | |
code | number | |
data | object | |
data.ratings | object | |
data.ratings.default | number |
{
"status": "ok",
"code": 200,
"data": {
"333682": {
"apitest-1400002865 ratings": {
"default": 50
}
}
}
}
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.
name | required | type | description |
---|---|---|---|
collectionId | true | string | The Collection ID to post to. (For example: 10633838.) |
name | required | type | description |
---|---|---|---|
rating | true | string | 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). |
lftoken | true | string | A Livefyre Authentication token for the user wishing to post content into the Collection. This is returned from the Auth endpoint. |
Post Rating
property | type | description |
---|---|---|
status | string | |
code | number | |
data | object | |
data.ratings | object | |
data.ratings.default | number | |
author | string |
{
"status": "ok",
"code": 200,
"data": {
"ratings": {
"default": 50
},
"author": "system@client-solutions.fyre.co"
}
}
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.
name | required | type | description |
---|---|---|---|
b64articleId | true | string | The article ID you chose to uniquely identify a collection within your Site, encoded using Base64. |
siteId | true | string | The Livefyre-provided ID for the website or application to which the Collection belongs. For example: 303617. |
name | required | type | description |
---|---|---|---|
numQuantiles | true | number | 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. |
Ratings Breakdown
property | type | description |
---|---|---|
status | string | |
code | string | |
data | object | |
data.default | object | |
data.default.average | number | |
data.default.distribution | array | |
data.default.distribution.[] | integer |
{
"status": "ok",
"code": 200,
"data": {
"default": {
"average": 50,
"distribution": [
0,
0,
1,
0,
0
]
}
}
}
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.
name | required | type | description |
---|---|---|---|
user | true | string | The ID of the user to get ratings for. |
User Reviews
property | type | description |
---|---|---|
content | array | |
content.[] | object | |
content.[].source | number | |
content.[].content | object | |
content.[].content.parentId | string | |
content.[].content.bodyHtml | string | |
content.[].content.id | string | |
content.[].content.authorId | string | |
content.[].content.updatedAt | number | |
content.[].content.annotations | object | |
content.[].content.annotations.ratings | object | |
content.[].content.annotations.upvotes | number | |
content.[].content.annotations.downvotes | number | |
content.[].content.annotations.replies | number | |
content.[].createdAt | number | |
content.[].collection | object | |
content.[].collection.id | string | |
content.[].collection.articleId | string | |
content.[].collection.url | string | |
content.[].collection.title | string | |
content.[].vis | number | |
content.[].type | number | |
authors | object | |
authors.[] | object | |
authors.[].displayName | string | |
authors.[].tags | array | |
authors.[].tags.[] | string | |
authors.[].profileUrl | string | |
authors.[].avatar | string | |
authors.[].type | number | |
authors.[].id | string |
{
"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"
}
}
}