GET /api/dropbox/pictures/{PictureID}

Returns a picture that was uploaded to the Dropbox for a resource.

Note: The Dropbox is a temporary location for images. Once the picture is assigned to the resource, the temporary image is cleared out of the Dropbox. After this, you will get a 404 (Not Found) on this operation.

For a training exercise that uses this operation, including video, see Example: Adding an App Avatar.

Authorization Roles/Permissions: This operation applies to all users.

This topic includes the following sections:

HTTP Method

GET

URL

https://{hostname}/api/dropbox/pictures/{PictureID}

Sample Request

The example below shows a request for a specific avatar.

Request URL #1

Returns the specified image at the default size (size of the uploaded image).

https://{hostname}/api/dropbox/pictures/1542

Request URL #2

With the optional size parameter, returns the specified image at a size of 100 pixels square.

https://{hostname}/api/dropbox/pictures/1542?size=100

Sample request headers

GET /api/dropbox/pictures/1542?size=512 HTTP/1.1
Host: {hostname}
Accept: image/png,image/*;q=0.8,*/*;q=0.5
AtmoAuthToken_acmepaymentscorp=TokenID%3Dcd36a4bd-e600-4e99-961a-c4ca0cfc93cd%2Cclaimed_id%3Durn%3Aatmosphere%3Auser%3Aacmepaymentscorp%3A14b1902f-3dfc-43e3-b09a-81137f091b96%2CissueTime%3D1614802132363%2CexpirationTime%3D1614803992357%2C...
X-Csrf-Token_acmepaymentscorp: TokenID%3D8ed70a13-8469-11e8-b37a-b155e4eabeb8%2CexpirationTime%3D153...

Sample request body

Not applicable.

Request Headers

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

Header Description
Accept image/jpeg
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
PictureID Path long Required The Dropbox ID for the picture.
size Query integer Optional 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 requested image.

Sample Response

The sample response below shows successful completing of the request.

Sample response headers

HTTP/1.1 200 OK
Date: Fri, 28 Sep 2018 15:47:27 GMT
Content-Type: image/jpeg

Sample response body

The response body is the image.

The example below shows a successful response to this operation in Postman.

Postman: Dropbox service, getPicture operation, successful response

Response Headers

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

Header Description
Content-Type image/jpeg

Response Body

Name Type Description
Response image The avatar associated with the resource; generally a JPG file

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 image had already been assigned to a resource in the platform, and was no longer in the Dropbox, which is a temporary location.
500 An error occurred processing the call.

More information about Akana API Platform API error messages.