Retrieves all email aliases for a user. The collection does not include the primary login for the user.
Returns a collection of email aliases.
An unexpected client error.
curl -X GET https://api.box.com/2.0/users/12345/email_aliases \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxCollection<BoxEmailAlias> aliases = await client.UsersManager
.GetEmailAliasesAsync(userId: "33333");
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('User {0} has email alias {1}'.format(user.id, alias.email))
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"))")
}
}