List user's email aliases

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

Retrieves all email aliases for a user. The collection does not include the primary login for the user.

Request

application/json

Path Parameters

stringin pathrequired
12345

The ID of the user.

Response

application/jsonEmail aliases

Returns a collection of email aliases.

application/jsonClient error

An unexpected client error.

get
List user's email aliases
You can now try out some of our APIs live, right here in the documentation.
Log In

Request Example

cURL
curl -X GET https://api.box.com/2.0/users/12345/email_aliases \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
.NET
BoxCollection<BoxEmailAlias> aliases = await client.UsersManager
    .GetEmailAliasesAsync(userId: "33333");
Java
BoxUser user = new BoxUser(api, "0");
Collection<EmailAlias> emailAliases = user.getEmailAliases();
Python
user_id = '33333'
user = client.user(user_id)
email_aliases = user.get_email_aliases()
for alias in email_aliases:
    print('User {0} has email alias {1}'.format(user.id, alias.email))
Node
client.users.getEmailAliases('33333')
    .then(emailAliases => {
        /* emailAliases -> {
            total_count: 2,
            entries: 
            [ { type: 'email_alias',
                id: '1234',
                is_confirmed: true,
                email: 'user+foo@example.com' },
                { type: 'email_alias',
                id: '1235',
                is_confirmed: true,
                email: 'user+bar@example.com' } ] }
        */
    });
iOS
client.users.listEmailAliases(userId: "33333") { (result: Result<EntryContainer<User>, BoxSDKError>) in
    guard case let .success(aliasCollection) = result else {
        print("Error retrieving email aliases")
        return
    }

    print("User has \(aliasCollection.totalCount) email aliases:")
    for alias in aliasCollection.entries {
        print("- \(alias.email) (\(alias.isConfirmed ? "Confirmed" : "Not Confirmed"))")
    }
}