GET /api/{service}/{ID}/avatars/{AvatarVersionID}.png

Retrieves the specified avatar version associated with the specified resource. The avatar might be the current one or an earlier one.

For additional usage information, see Usage Note: Difference Between getAvatar and getDefaultAvatar.

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}/{ID}/avatars/{AvatarVersionID}.png

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 avatar for a specific API.

Sample Request URL

https://{hostname}/api/apis/api19427.acmepaymentscorp/avatars/apiversion19429.acmepaymentscorp.png

Sample request headers

Accept: image/png

Sample request body

Not applicable.

Sample request: Apps service

The example below shows a request for the avatar for the specified app/app version.

Sample Request URL

https://{hostname}/api/apps/app16964.acmepaymentscorp/avatars/4iXro2Uxs2h4LviCshR9pK9w.acmepaymentscorp.png

Sample request headers

Accept: image/png

Sample request body

Not applicable.

Sample request: Groups service

The example below shows a request for the avatar for the specified group.

https://{hostname}/api/apis/api18969.acmepaymentscorp/avatars/8a8dd915-5a17-4c23-bbbe-ab5022f88185.png?size=75

Sample request headers

Accept: image/png

Sample request body

Not applicable.

Sample request: Users service

The example below shows a request for the avatar for the specified user. In the context of the Users service, the UserID is used twice in the URL since only apps and APIs have different versions.

https://{hostname}/api/users/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp/avatars/522320b9-cb6b-495d-ae07-e4b3bfdb3f6a.acmepaymentscorp.png

Sample request headers

Accept: image/png

Sample request body

Not applicable.

Request Headers

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

Header Description
Accept image/png
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 avatar is being requested.
AvatarVersionID Path string Required The AvatarVersionID for the avatar version being requested. By default, when the first avatar is assigned, the ID is the same as the resource ID. If the avatar is changed for a different one, a different unique AvatarVersionID is assigned.
size Query Integer Required The size, in pixels, for the width or height of the avatar image (the image should always be square). We recommend a size of 75 pixels.

Response

If successful, this operation returns HTTP status code 200, with the avatar for the specified resource in the response body.

Sample Response

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

Sample response: APIs service

The sample response below shows successful completion of this operation.

Sample response headers

Status Code: 200 OK
Cache-Control: public, max-age=604800
Content-Type: image/png

Sample response body

The response body is the image.

Sample response: Apps service

The sample response below shows successful completion of this operation.

Sample response headers

Status Code: 200 OK
Cache-Control: public, max-age=604791
Content-Type: image/png
Date: Wed, 22 May 2013 18:49:34 GMT

Sample response body

The response body is the image.

Sample response: Groups service

The sample response below shows successful completion of this operation.

Sample response headers

HTTP/1.1 200 OK
Content-Type: image/png
Date: Fri, 21 Jun 2013 18:44:51 GMT

Sample response body

The response body is the image.

Sample response: Users service

The sample response below shows successful completion of this operation.

Sample response headers

Status Code: 200 OK
Cache-Control: public, max-age=604800
Content-Type: image/png
Date: Thu, 23 May 2013 18:37:59 GMT

Sample response body

The response body is the image.

Response Headers

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

Header Description
Content-Type image/png
Cache-Control public, max-age=604800. For information about caching, see How the Platform API Uses Caching.

Response Body

Name Type Description
Response image The avatar for the specified resource.

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
500 An error occurred processing the call.

More information about Akana API Platform API error messages.