Sample - Box Platform API
GET/users/{user_id}/avatar

Get a user avatar

Retrieves an image of a user's avatar. Supply user_id to identify the user whose avatar you want to retrieve; the response contains image data when an avatar is available.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter
user_idstringrequired
The unique identifier of the user whose avatar to retrieve.

2 status codes
200Returns the user's avatar image as binary image data when an avatar is available.
defaultReturned when an unexpected client error occurs; the response contains a generic error object with an error code, message, request identifier, and optional context.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.

Error handling

user_id must identify the user whose avatar you want to retrieve. The value must be provided as a string identifying an existing user.