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:asec

    The 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:desc

    The 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
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : ResultList DataFormResults
Type: object
Title: ResultList DataFormResults
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : DataFormResults
Type: object
Title: DataFormResults
Show Source
Nested Schema : LocaleKey
Type: object
Title: LocaleKey
Show Source
Nested Schema : questions
Type: array
To Many Relationship to DetailQuestionResult
Show Source
Nested Schema : UserKey
Type: object
Title: UserKey
Show Source
  • Email of the User object
  • 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.
  • 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
  • User's full name
  • The unique record ID of the User object.
Nested Schema : DetailQuestionResult
Type: object
Title: DetailQuestionResult
Show Source
  • answers
    To Many Relationship to DetailAnswerResult
  • The unique record ID of the DetailQuestionResult object.
  • 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: array
To Many Relationship to DetailAnswerResult
Show Source
Nested Schema : DetailAnswerResult
Type: object
Title: DetailAnswerResult
Show Source
  • The unique record ID of the DetailAnswerResult object.
  • 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 of the DetailAnswerResult object
  • Value of the DetailAnswerResult object
Back to Top

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
}
Back to Top