GET /api/{service}/versions/{ID}/ratings/{UserID}

Returns a specific user's rating for a resource.

This operation is used by the following services:

  • APIs service
  • Apps service
  • Groups service
  • Users 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.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/{service}/versions/{ID}/ratings/{UserID}

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 a specific user's rating of a specific API version.

Sample Request URL

https://{hostname}/api/apis/versions/apiversion23609.acmepaymentscorp/ratings/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp

Sample request headers

Accept: application/json

Sample request body

Not applicable.

Sample request: Apps service

The example below shows a request for a specific user's rating of a specific app version.

Sample request URL

https://{hostname}/api/apps/versions/90VsIX3WmpP32sqoYQk8jj4J.acmepaymentscorp/ratings/957482b9-ck7f-0gk5-ae07-9flgok5djtus.acmepaymentscorp

Sample request headers

GET /api/apps/versions/90VsIX3WmpP32sqoYQk8jj4J.acmepaymentscorp/ratings/957482b9-ck7f-0gk5-ae07-9flgok5djtus.acmepaymentscorp
Host: {hostname}
Accept: application/json, text/javascript, */*; q=0.01

Sample request body

Not applicable.

Sample request: Groups service

The example below shows a request for a specific user's rating of a specific group.

Sample request URL

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

Sample request headers

Accept: application/json

Sample request body

Not applicable.

Sample request: Users service

The example below shows a request for a specific user's rating of a specific app version.

Sample request URL

https://{hostname}/api/apps/versions/AMyrWWlF0Qj2ZPGqF8dPsa7O.acmepaymentscorp/ratings/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp

Sample request headers

GET /api/apps/versions/AMyrWWlF0Qj2ZPGqF8dPsa7O.acmepaymentscorp/ratings/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp?_=1369932294081 HTTP/1.1
Host: {hostname}
Accept: application/json, text/javascript, */*; q=0.01

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 app version or API version: AppVersionID or APIVersionID.
UserID Path String Required UserID of the user whose rating is being retrieved.

Response

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

Sample Response

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

Sample response: APIs service

The sample response below shows that the user's rating for this API version is 3.

Sample response headers: application/json

Status Code: 200 OK
Content-Type: application/json
Date: Thu, 23 May 2013 19:54:46 GMT

Sample response body: application/json

{
  "ID": "apiversion23609.acmepaymentscorp",
  "UserID": "522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp",
  "Rating": 3
}

Sample response: Apps service

The sample response below shows that the user's rating for this app is 4.

Sample response headers

Status Code: 200 OK
Content-Type: application/json
Date: Fri, 14 Dec 2012 21:45:46 GMT

Sample response body: application/json

{
  "ID" : "90VsIX3WmpP32sqoYQk8jj4J.acmepaymentscorp",
  "UserID" : "957482b9-ck7f-0gk5-ae07-9flgok5djtus.acmepaymentscorp",
  "Rating" : 4
}

Sample response: Groups service

The sample response below shows that the user's rating for this group is 5.

Sample response headers: application/json

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

Sample response body: application/json

{
  "ID" : "group24386.acmepaymentscorp",
  "UserID" : "user23509.acmepaymentscorp",
  "Rating" : 5
}

Sample response: Users service

The sample response below shows that the user's rating for this app is 2.

Sample response headers: application/json

HTTP/1.1 200 OK
Content-Type: application/json
Date: Thu, 30 May 2013 16:44:54 GMT

Sample response body: application/json

{
  "ID" : "AMyrWWlF0Qj2ZPGqF8dPsa7O.acmepaymentscorp",
  "UserID" : "522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp",
  "Rating" : 2
}

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
Rating Rating Includes information about a specific rating.

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
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.
404

The resource could not be found.

For example, you might get this if the specified user hasn't rated the specified resource, or if there was an error in the UserID.

500 An error occurred processing the call.

More information about Akana API Platform API error messages.