GET /api/{service}[/versions/]{ID}/ratings/summary

Retrieves a summary of the ratings for a resource.

This operation is used by the following services:

  • APIs service
  • Apps service
  • Groups service

Authorization Roles/Permissions: Must be logged in and have permission to view the requested resources. If the user is logged in but doesn't have permission to view certain resources, the operation works, but limited (or empty) results are returned.

Note: Generally, the Akana API Platform maintains averaged ratings for each version of an app or API, aggregating and averaging the ratings based on the specific version that the user is rating rather than for the app or API as a whole. The exception to this is the search interface, where the app or API is displayed as a single line item with the average rating of all versions combined.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/{service}[/versions]/{ID}/ratings/summary

Sample Request

This section includes sample requests for different services that use this operation:

Sample request: APIs service

The example below shows a request for the ratings summary for the specified API to be returned in JSON.

Request URL #1

https://{hostname}/api/apis/versions/api18969.acmepaymentscorp/ratings/summary

Request URL #2

https://{hostname}/api/apis/versions/apiversion19184.acmepaymentscorp/ratings/summary

Sample request headers

Accept: application/json

Sample request body

Not applicable.

Sample request: Apps service

The example below shows a request for the ratings summary for the specified app. A JSON response is requested.

Sample request URL

https://{hostname}/api/apps/versions/app16964.acmepaymentscorp/ratings/summary

Sample request headers

Accept: application/json

Sample request body

Not applicable.

Sample request: Groups service

The example below shows a request for the ratings summary for the specified group. A JSON response is requested.

Sample request URL

https://{hostname}/api/groups/group24386.acmepaymentscorp/ratings/summary

Sample request headers

Accept: application/json

Sample request body

Not applicable.

Request Headers

For general information on request header values, refer to HTTP Request Headers.

Header Description
Accept text/xml or application/json
Cookie AtmoAuthToken_{fedmemberid}={cookie value, which usually starts with TokenID}—The platform cookie. This is the Akana API Platform authorization token, and must be sent with every API request that requires login. For more information and an example, see Session cookies.
X-Csrf-Token_{fedmemberID} The CSRF prevention header; may or may not be required, depending on platform settings. See CSRF Prevention on the Platform. By default, the CSRF header is not required for GET operations and is required for all others, with a few exceptions relating to user login.

Request Parameters

Parameter Parm Type Data Type Required Description
ID Path String Required The unique ID of the resource for which the ratings are being retrieved: AppVersionID, APIVersionID, or GroupID.

Response

If successful, this operation returns HTTP status code 200, with the ratings summary in JSON or XML.

Sample Response

This section includes sample responses for different services that use this operation:

Sample response: APIs service

The sample responses below shows that the specified API has three ratings.

Sample response headers: application/json

Status Code: 200 OK
Content-Type: application/json
Date: Mon, 11 Mar 2013 15:56:57 GMT

Sample response body: application/json

{
  "Five" : 2,
  "Four" : 1,
  "Three" : 0,
  "Two" : 0,
  "One" : 0
}

Sample response: Apps service

The sample responses below shows that the specified app has a total of five ratings in four categories.

Sample response headers

Status Code: 200 OK
Content-Type: application/json
Date: Tue, 30 Apr 2013 18:37:42 GMT

Sample response body

{
  "Five" : 1,
  "Four" : 1,
  "Three" : 1,
  "Two" : 0,
  "One" : 2
}

Sample response: Groups service

The sample responses below shows that the specified group has a total of five ratings in three categories.

Sample response headers

Status Code: 200 OK
Content-Type: application/json
Date: Wed, 19 Jun 2013 15:55:13 GMT

Sample response body

{
  "Five" : 2,
  "Four" : 2,
  "Three" : 1,
  "Two" : 0,
  "One" : 0
}

Response Headers

For general information on response header values, refer to HTTP Response Headers.

Header Description
Content-Type text/xml or application/json

Response Body

Name Type Description
RatingSummary RatingSummary An aggregated, averaged summary of individual user ratings for the resource, including the current ratings count for each possible value (1, 2, 3, 4, or 5). Used only in response messages.

Error Codes/Messages

If the call is unsuccessful an error code/message is returned. One or more examples of possible errors for this operation are shown below.

Item Value
400 Returned if the client sends invalid parameters or body content. For example, you might get this response if there is a typo in the request URL.
401 Unauthorized. For example, you would get this response if you didn't include the custom X-Csrf-Token_{fedmemberID} header in the request, when it was required by the platform settings; or if you included an invalid or expired value for this header. You would also get this response for any operation that requires login (almost all) if the login cookie was missing.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.