Box Developer Documentation
Latest version

Get user avatar

get
https://api.box.com/2.0
/users/:user_id/avatar

This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

Retrieves an image of a the user's avatar.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The ID of the user.

Response

image/jpg

When an avatar can be found for the user the image data will be returned in the body of the response.

application/jsonClient error

An unexpected client error.

get
Get user avatar
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versionig strategy.


cURL
curl -i -X GET "https://api.box.com/2.0/users/12345/avatar" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.avatars.getUserAvatar(user.id);
Python v10
client.avatars.get_user_avatar(user.id)
.NET v10
await client.Avatars.GetUserAvatarAsync(userId: user.Id);
Swift v10
try await client.avatars.getUserAvatar(userId: user.id, downloadDestinationUrl: destinationPath)
Java v10
client.getAvatars().getUserAvatar(user.getId())
Java v4
String userID = "33333";
// some stream do download avatar
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()){
  BoxUser user=new BoxUser(api,userID);
  user.downloadAvatar(outputStream);
} catch (IOException e) {
  throw new RuntimeException(e);
}
Python v3
avatar = client.user('33333').get_avatar()
.NET v5
Stream imageStream = await client.UsersManager.GetUserAvatar(string userId);
Node v3
client.users.getAvatar('22222')
    .then(avatarImageStream => {

        avatarImageStream.on('data', bytes => {
            // read avatar image bytes
        });
    });