Reviews Resource

GET /v2/reviews

Request Parameters
name type description default
filter query  
pageIndex query 0
pageSize query 20
sort query timeOfCreation:desc
Response Body
media type data type description
application/json PaginatedResponse (JSON)

Example

Request
GET /v2/reviews
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "list" : [ {
    "source" : "...",
    "userTO" : {
      "attributes" : {
        "property1" : { },
        "property2" : { }
      },
      "name" : "...",
      "key" : "..."
    },
    "commentsCount" : 12345,
    "entityKey" : "...",
    "timeOfLastChange" : 12345,
    "timeOfCreation" : 12345,
    "key" : "...",
    "description" : "...",
    "type" : "...",
    "restricted" : [ "...", "..." ],
    "viewAble" : [ "...", "..." ],
    "updateable" : [ "...", "..." ],
    "richDescription" : "...",
    "score" : 12345.0,
    "customProperties" : [ {
      "description" : "...",
      "value" : { },
      "facetAble" : true,
      "name" : "...",
      "type" : "...",
      "displayName" : "..."
    }, {
      "description" : "...",
      "value" : { },
      "facetAble" : true,
      "name" : "...",
      "type" : "...",
      "displayName" : "..."
    } ]
  }, {
    "source" : "...",
    "userTO" : {
      "attributes" : {
        "property1" : { },
        "property2" : { }
      },
      "name" : "...",
      "key" : "..."
    },
    "commentsCount" : 12345,
    "entityKey" : "...",
    "timeOfLastChange" : 12345,
    "timeOfCreation" : 12345,
    "key" : "...",
    "description" : "...",
    "type" : "...",
    "restricted" : [ "...", "..." ],
    "viewAble" : [ "...", "..." ],
    "updateable" : [ "...", "..." ],
    "richDescription" : "...",
    "score" : 12345.0,
    "customProperties" : [ {
      "description" : "...",
      "value" : { },
      "facetAble" : true,
      "name" : "...",
      "type" : "...",
      "displayName" : "..."
    }, {
      "description" : "...",
      "value" : { },
      "facetAble" : true,
      "name" : "...",
      "type" : "...",
      "displayName" : "..."
    } ]
  } ],
  "totalCount" : 12345
}
                
              

POST /v2/reviews

A POST request to the /review endpoint creates a user review.

Request Body
media type data type description
application/json UserReview (JSON) A UserReview object including the review content, the object to which the review applies and the user to whom the review is attributed.
Response Body
media type data type description
application/json UserReview (JSON) The new UserReview object including the unique key assigned to it.

Example

Request
POST /v2/reviews
Content-Type: application/json
Accept: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}
                
              

PUT /v2/reviews

A PUT request to the /review endpoint updates a user review.

Request Body
media type data type description
application/json UserReview (JSON) A UserReview object including the updated properties of the review. Only properties provided are updated.
Response Body
media type data type description
application/json UserReview (JSON) The updated UserReview object.

Example

Request
PUT /v2/reviews
Content-Type: application/json
Accept: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}
                
              

DELETE /v2/reviews/{key}

A DELETE request to the /review endpoint deletes a user review identified by key.

Request Parameters
name type description
key path The unique identifier for a user review.
Response Body
media type data type description
application/json object (JSON)

Example

Request
DELETE /v2/reviews/{key}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /v2/reviews/aggregate/{datasourceKey}

Request Parameters
name type description
datasourceKey path
Response Body
media type data type description
application/json ReviewsAggregate (JSON)

Example

Request
GET /v2/reviews/aggregate/{datasourceKey}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "percentageOf2stars" : "...",
  "percentageOf1stars" : "...",
  "totalReviewers" : 12345,
  "percentageOf3stars" : "...",
  "totReviewsCount" : 12345,
  "noOf4stars" : 12345,
  "weightedAvg" : "...",
  "noOf1stars" : 12345,
  "noOf5stars" : 12345,
  "percentageOf4stars" : "...",
  "noOf2stars" : 12345,
  "noOf3stars" : 12345,
  "percentageOf5stars" : "..."
}
                
              

GET /v2/reviews/entity/{entityKey}

A GET request to the /review/entity/{entityKey} endpoint returns reviews on a particular entity identified by the entityKey.

Request Parameters
name type description
entityKey path The unique identifier for the entity.
Response Body
media type data type description
application/json array of UserReview (JSON) An array of UserReview objects in JSON format.

Example

Request
GET /v2/reviews/entity/{entityKey}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
} ]
                
              

GET /v2/reviews/review/{reviewKey}

A GET request to the /review/{reviewKey} endpoint retrieves a particular review based on review key.

Request Parameters
name type description
reviewKey path The unique reviewKey of the user review which has to be retrieved.
Response Body
media type data type description
application/json UserReview (JSON) The UserReview object to which the unique key assigned to it.

Example

Request
GET /v2/reviews/review/{reviewKey}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}
                
              

GET /v2/reviews/user/{user}

A GET request to the /review/user/{user} endpoint returns reviews generated by a particular user.

Request Parameters
name type description
user path The name of the user profile.
Response Body
media type data type description
application/json array of UserReview (JSON) An array of UserReview objects in JSON format.

Example

Request
GET /v2/reviews/user/{user}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
} ]
                
              

POST /v2/reviews/users/{user}

Request Parameters
name type description
user path
Request Body
media type data type
application/json UserReview (JSON)
Response Body
media type data type description
application/json UserReview (JSON)

Example

Request
POST /v2/reviews/users/{user}
Content-Type: application/json
Accept: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "rating" : 12345,
  "title" : "...",
  "referenceKey" : "...",
  "source" : "...",
  "userTO" : {
    "attributes" : {
      "property1" : { },
      "property2" : { }
    },
    "name" : "...",
    "key" : "..."
  },
  "commentsCount" : 12345,
  "entityKey" : "...",
  "timeOfLastChange" : 12345,
  "timeOfCreation" : 12345,
  "key" : "...",
  "description" : "...",
  "type" : "...",
  "restricted" : [ "...", "..." ],
  "viewAble" : [ "...", "..." ],
  "updateable" : [ "...", "..." ],
  "richDescription" : "...",
  "score" : 12345.0,
  "customProperties" : [ {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  }, {
    "description" : "...",
    "value" : { },
    "facetAble" : true,
    "name" : "...",
    "type" : "...",
    "displayName" : "..."
  } ]
}