Get rating results of content
get
/km/api/v1/content/{id}/ratings
This method returns a list of all the ratings results for a content record.
Example URIs
The example URIs for this method are as follows:
http://<IM_REST_API_HOST>/km/api/latest/content/{id}/ratings?orderBy=dateAdded:asecThe request returns a paginated list of all the ratings results for a content record sorted by date added in ascending order.
http://<IM_REST_API_HOST>/km/api/latest /content/{id}/ratings?orderBy=dateAdded:descThe request returns a paginated list of all the ratings results for a content record sorted by date added in descending order. The fields that you can sort are recordId, dateAdded, and dateModified.
Request
Path Parameters
-
id(required): string
The content identifier.
Response
Supported Media Types
- application/json
- application/xml
200 Response
OK.
Root Schema : ResultList DataFormResults
Type:
objectTitle:
Show Source
ResultList DataFormResults-
count:
integer
Number of resource instances returned in the current range.
-
hasMore:
boolean
Boolean value that is set to true if more resources are available on the server than the subset returned in current page.
-
items:
array items
-
limit:
integer
Actual paging size used by the server.
-
links:
array links
-
offset:
integer
Offset value used in the current page.
-
totalResults:
integer
Total count of the resource instances, including both the instances in the current range and the instances on the server that satisfy the request.
Nested Schema : items
Type:
Show Source
array-
Array of:
object DataFormResults
Title:
DataFormResults
Nested Schema : links
Type:
Show Source
array-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
Nested Schema : DataFormResults
Type:
objectTitle:
Show Source
DataFormResults-
dateAdded:
string(date-time)
The date when the DataFormResults object was created or added
-
dateModified:
string(date-time)
The date when the DataFormResults object was last modified.
-
links:
array links
-
locale:
object LocaleKey
Title:
LocaleKey -
questions:
array questions
To Many Relationship to DetailQuestionResult
-
recordId:
string
The unique record ID of the DataFormResults object.
-
user:
object UserKey
Title:
UserKey
Nested Schema : links
Type:
Show Source
array-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
Nested Schema : LocaleKey
Type:
objectTitle:
Show Source
LocaleKey-
links:
array links
-
recordId:
string
The unique identifier of the Locale object.
Nested Schema : questions
Type:
arrayTo Many Relationship to DetailQuestionResult
Show Source
-
Array of:
object DetailQuestionResult
Title:
DetailQuestionResult
Nested Schema : UserKey
Type:
objectTitle:
Show Source
UserKey-
email:
string
Email of the User object
-
externalId:
integer
The ExternalId is the Id of the corresponding User from an external system. It, along with ExternalType, can be used to bridge the gap between a User from this system and a User from an external system.
-
externalType:
string
The ExternalType is the type of the corresponding User from an external system. It, along with ExternalId, can be used to bridge the gap between a User from this system and a User from an external system.
-
links:
array links
-
name:
string
User's full name
-
recordId:
string
The unique record ID of the User object.
Nested Schema : instanceLink
Type:
objectMetadata describing link description objects that MAY appear in the JSON instance representation.
Show Source
-
href(required):
string
URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the "templated" property must be set to true.
-
mediaType:
string
Media type, as defined by RFC 2046, describing the link target.
-
method:
string
HTTP method for requesting the target of the link.
-
profile:
string
Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource..
-
rel(required):
string
Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile.
-
templated:
boolean
Boolean flag that specifies that "href" property is a URI or URI Template. If the property is a URI template, set this value to true. By default, this value is false.
Nested Schema : links
Type:
Show Source
array-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
Nested Schema : DetailQuestionResult
Type:
objectTitle:
Show Source
DetailQuestionResult-
answers:
array answers
To Many Relationship to DetailAnswerResult
-
recordId:
string
The unique record ID of the DetailQuestionResult object.
-
referenceKey:
string
The reference key for the DetailQuestionResult object. DetailQuestionResult objects support multiple languages. This field can be used to identify the associated objects for all languages.
Nested Schema : answers
Type:
arrayTo Many Relationship to DetailAnswerResult
Show Source
-
Array of:
object DetailAnswerResult
Title:
DetailAnswerResult
Nested Schema : DetailAnswerResult
Type:
objectTitle:
Show Source
DetailAnswerResult-
recordId:
string
The unique record ID of the DetailAnswerResult object.
-
referenceKey:
string
The reference key for the DetailAnswerResult object. DetailAnswerResult objects support multiple languages. This field can be used to identify the associated objects for all languages.
-
text:
string
Text of the DetailAnswerResult object
-
value:
integer
Value of the DetailAnswerResult object
Nested Schema : links
Type:
Show Source
array-
Array of:
object instanceLink
Metadata describing link description objects that MAY appear in the JSON instance representation.
Examples
The following example shows how to find all ratings results for a Content record.
curl -X GET "https://<IM_REST_API_HOST>/km/api/latest/content/{id}/ratings" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json"
Example of Response Body
The following example shows the contents of the response body in JSON format:
{
"items": [
{
"locale": {
"recordId": "en_US",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/locales/en_US",
"mediaType": "application/json, application/xml",
"method": "GET"
}
]
},
"questions": [
{
"answers": [
{
"value": 2,
"recordId": "B73836830DC0401FA931120E4634408A",
"referenceKey": "YES_OR_NO_RATING_A2"
}
],
"recordId": "94AEF5ABE53A4E609EFD0A208E9007C3",
"referenceKey": "YES_OR_NO_RATING_Q1"
}
],
"user": {
"recordId": "503DA13674984E0BA909F2BFAAEEC06A",
"name": "Default Administrator",
"email": "admin@example.com",
"externalType": "ACCOUNT",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/users/503DA13674984E0BA909F2BFAAEEC06A",
"mediaType": "application/json, application/xml",
"method": "GET"
}
]
},
"recordId": "00E16FA3AF5442F9A5B7E3C085D2DACD",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/content/A2231630FC6C491A848E579138F25664/ratings",
"mediaType": "application/json, application/xml",
"method": "GET"
}
],
"dateAdded": "2018-09-06T14:15:14-0700",
"dateModified": "2018-09-06T14:15:14-0700"
},
{
"locale": {
"recordId": "es_ES",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/locales/es_ES",
"mediaType": "application/json, application/xml",
"method": "GET"
}
]
},
"questions": [
{
"answers": [
{
"value": 5,
"recordId": "29C9EEA5CB2B484A94762A4B1517EB57",
"referenceKey": "A5"
}
],
"recordId": "D56585C3385846B5A8D700593E1C96F4",
"referenceKey": "Q1"
}
],
"user": {
"recordId": "F74010DC1794481CA3272D74F1FCC07E",
"name": "Guest User",
"externalType": "CONTACT",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/users/F74010DC1794481CA3272D74F1FCC07E",
"mediaType": "application/json, application/xml",
"method": "GET"
}
]
},
"recordId": "4E44495FBFDB4498B63A382A8390A04E",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/content/A2231630FC6C491A848E579138F25664/ratings",
"mediaType": "application/json, application/xml",
"method": "GET"
}
],
"dateAdded": "2018-09-10T23:45:40-0700",
"dateModified": "2018-09-10T23:45:40-0700"
},
{
"locale": {
"recordId": "es_ES",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/locales/es_ES",
"mediaType": "application/json, application/xml",
"method": "GET"
}
]
},
"questions": [
{
"answers": [
{
"value": 5,
"recordId": "29C9EEA5CB2B484A94762A4B1517EB57",
"referenceKey": "A5"
}
],
"recordId": "D56585C3385846B5A8D700593E1C96F4",
"referenceKey": "Q1"
}
],
"user": {
"recordId": "F74010DC1794481CA3272D74F1FCC07E",
"name": "Guest User",
"externalType": "CONTACT",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/users/F74010DC1794481CA3272D74F1FCC07E",
"mediaType": "application/json, application/xml",
"method": "GET"
}
]
},
"recordId": "CE35BC48D50C4235BF16689CE56CBF0B",
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/content/<content ID>/ratings",
"mediaType": "application/json, application/xml",
"method": "GET"
}
],
"dateAdded": "2018-09-11T00:45:01-0700",
"dateModified": "2018-09-11T00:45:01-0700"
}
],
"hasMore": false,
"limit": 20,
"offset": 0,
"links": [
{
"rel": "canonical",
"href": "<IM_REST_API_HOST>/km/api/latest/content/<content ID>/ratings?limit=20&offset=0",
"mediaType": "application/json, application/xml",
"method": "GET"
}
],
"count": 3
}