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

Back to top

URL

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

Back to top

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.

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.

Back to top

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.

Back to top

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.

Back to top

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.

Back to top

Request Headers

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

Header Description
Accept text/xml or application/json
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.

Back to top

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.

Back to top

Response

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

Back to top

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 headers: application/xml

Content-Type: text/xml

Sample response body: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Rating xmlns="http://soa.com/xsd/resource/1.0" xmlns:ns2="http://soa.com/xsd/user/1.0">
  <ID>apiversion23609.acmepaymentscorp</ID>
  <ns2:UserID>522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp</ns2:UserID>
  <Rating>3</Rating>
</Rating>

Back to top

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 body: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Rating xmlns="http://soa.com/xsd/resource/1.0" xmlns:ns2="http://soa.com/xsd/user/1.0">
  <ID>90VsIX3WmpP32sqoYQk8jj4J.acmepaymentscorp</ID>
  <ns2:UserID>957482b9-ck7f-0gk5-ae07-9flgok5djtus.acmepaymentscorp</ns2:UserID>
  <Rating>4</Rating>
</Rating>

Back to top

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
}

Back to top

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
}

Sample response headers: application/xml

Content-Type: text/xml

Sample response body: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Rating xmlns="http://soa.com/xsd/resource/1.0" xmlns:ns2="http://soa.com/xsd/user/1.0">
  <ID>AMyrWWlF0Qj2ZPGqF8dPsa7O.acmepaymentscorp</ID>
  <ns2:UserID>522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp</ns2:UserID>
  <Rating>2</Rating>
</Rating>

Back to top

Response Headers

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

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

Back to top

Response Body

Name Type Description
Rating Rating Includes information about a specific rating.

Back to top

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.

Back to top

Related Topics