Retrieves all email aliases for a user. The collection does not include the primary login for the user.
12345
The ID of the user.
Returns a collection of email aliases.
An unexpected client error.
curl -i -X GET "https://api.box.com/2.0/users/12345/email_aliases" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.emailAliases.getUserEmailAliases(newUser.id);
client.email_aliases.get_user_email_aliases(new_user.id)
await client.EmailAliases.GetUserEmailAliasesAsync(userId: newUser.Id);
try await client.emailAliases.getUserEmailAliases(userId: newUser.id)
BoxUser user = new BoxUser(api, "0");
Collection<EmailAlias> emailAliases = user.getEmailAliases();
user_id = '33333'
user = client.user(user_id)
email_aliases = user.get_email_aliases()
for alias in email_aliases:
print(f'User {user.id} has email alias {alias.email}')
BoxCollection<BoxEmailAlias> aliases = await client.UsersManager
.GetEmailAliasesAsync(userId: "33333");
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' } ] }
*/
});
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"))")
}
}
{
"entries": [
{
"email": "alias@example.com",
"id": "11446498",
"is_confirmed": true,
"type": "email_alias"
}
],
"total_count": 5000
}