changeEmail
Use the changeEmail operation to change a user's email address.
This topic provides details about how to change a user's email address with SOAP web services code. For details about how to make this change in the NetSuite user interface, see Change Email Link and Your User Credentials.
This operation is supported as of the 2012.2 endpoint. The 2012.2 and later endpoints support changeEmail and changePassword operations.
Be aware that a user’s email address is not changed immediately. The old email address remains in effect until the new email address is validated by the user, through a validation link sent to the new address. A notification is also sent to the old address. This behavior is the same as when users change their email addresses through the user interface.
Request
The ChangeEmailRequest type is used for the request.
Element Name |
XSD Type |
Notes |
---|---|---|
changeEmail |
ChangeEmail |
|
The ChangeEmail type takes the following fields:
-
currentPassword
-
newEmail
-
newEmail2
-
justThisAccount
Response
The ChangeEmailResponse type is used for the response. It does not contain any fields.
Faults
This operation can throw one of the following faults. See SOAP Fault Status Codes for more information on faults.
-
InsufficientPermissionFault
-
InvalidAccountFault
-
InvalidCredentialsFault
-
InvalidVersionFault
-
ExceededRequestLimitFault
-
UnexpectedErrorFault
-
UserError
Sample Code
SOAP Request
<changeEmail xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<changeEmail>
<ns6:currentPassword xmlns:ns6="urn:core_2017_1.platform.webservices.netsuite.com">xxxxxxx</ ns6:currentPassword>
<ns7:newEmail xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com">newEmail@tester.com</ns7:newEmail>
<ns8:newEmail2 xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"> newEmail @tester.com</ns8:newEmail2>
<ns9:justThisAccount xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com">true</ns9:justThisAccount>
</changeEmail>
</changeEmail>
SOAP Response
<changeEmailResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<sessionResponse>
<platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
</sessionResponse>
</changeEmailResponse>
Java
public void test_ChangeEmail() throws Exception {
sessMgr.loginWithEmail("oldEmail@ws.com");
ChangeEmail c = new ChangeEmail();
c.setCurrentPassword("xxxxxx");
c.setNewEmail("newEmail@ws.com");
c.setNewEmail2("newEmail@ws.com");
c.setJustThisAccount(true);
sessMgr.getPort().changeEmail(c);
sessMgr.loginWithEmail("newEmail@ws.com");
}