Adds a new email alias to a user account..
12345
The ID of the user.
alias@example.com
The email address to add to the account as an alias.
Returns the newly created email alias object.
An unexpected client error.
curl -X POST https://api.box.com/2.0/users/12345/email_aliases \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-H 'Content-Type: application/json" '
-d '{
"email": "alias@example.com"
}'
BoxEmailAlias alias = await client.UsersManager
.AddEmailAliasAsync(userId: "33333", email: "user+foo@example.com");
BoxUser user = new BoxUser(api, "0");
user.addEmailAlias("user+alias@example.com");
user_id = '33333'
user = client.user(user_id)
email_alias = user.add_email_alias('alias@example.com')
client.users.addEmailAlias('33333', 'user+baz@example.com')
.then(alias => {
/* alias -> {
type: 'email_alias',
id: '12345',
is_confirmed: false,
email: 'user+baz@example.com' }
*/
});
client.users.createEmailAlias(
userId: "33333",
email: "user+alias@example.com"
) { (result: Result<EmailAlias, BoxSDKError>) in
guard case let .success(alias) = result else {
print("Error adding email alias")
return
}
print("Added email alias \(alias.email) — user must confirm")
}