Get customer account information
This method gets a customer’s account information.
This method requires customer authentication.
The API key must have the API_PERSONAL_INFORMATION_CLIENT_READ permission from the Client group.
Method name:
Client.getAccount()
Declaration:
public static IDataApiCall<GetAccountInformation> getAccount()
fun getAccount():IDataApiCall<GetAccountInformation>
Parameters:
No parameters required.
Return Value:
IDataApiCall<GetAccountInformation> object to execute the request.
Example:
private IDataApiCall<GetAccountInformation> getAccountCall;
private void getAccount(boolean isFacebook) {
if (getAccountCall != null) getAccountCall.cancel();
getAccountCall = Client.getAccount();
getAccountCall.execute(({ this.onGetAccountSuccessful() }), ({ this.onGetAccountFailure() });
}
private val getAccountCall:IDataApiCall<GetAccountInformation>
private fun getAccount(isFacebook:Boolean) {
if (getAccountCall != null) getAccountCall.cancel()
getAccountCall = Client.getAccount()
getAccountCall.execute(({ this.onGetAccountSuccessful() }), ({ this.onGetAccountFailure() })
}
Get customer's events
This method retrieves events for an authenticated customer.
This method requires customer authentication.
Method name:
Client.getEvents(clientEventsQuery)
Declaration:
public static IDataApiCall<List<ClientEventData>> getEvents(ClientEventsQuery clientEventsQuery)
fun getEvents(clientEventsQuery:ClientEventsQuery):IDataApiCall<List<ClientEventData>>
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| clientEventsQuery | ClientEventsQuery | yes | - | Object to create clientEvent query |
Return Value:
IDataApiCall<List<ClientEventData>> object to execute the request.
Example:
private IDataApiCall<List<ClientEventData>> getEventClientsCall;
if (getEventClientsCall != null) getEventClientsCall.cancel();
getEventClientsCall = Client.getEvents(clientEventsQuery);
getEventClientsCall.execute(({ this.onSuccess() }), ({ this.onFailure() });
private val getEventClientsCall:IDataApiCall<List<ClientEventData>>
if (getEventClientsCall != null) getEventClientsCall.cancel()
getEventClientsCall = Client.getEvents(clientEventsQuery)
getEventClientsCall.execute(({ this.onSuccess() }), ({ this.onFailure() })
Update customer account basic information
This method updates a customer’s account’s basic information (without identification data: uuid, customId, email).
This method requires the context object with the customer’s account information. Omitted fields are not modified.
This method does not require customer authentication and can be used by anonymous profiles.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.22.0 | 5.21.0 | 0.24.0 | 1.4.0 |
The API key must have the API_BASIC_INFORMATION_CLIENT_UPDATE permission from the Client group.
Method name:
Client.updateAccountBasicInformation(accountInformation)
Declaration:
public static IApiCall updateAccountBasicInformation(@NonNull UpdateAccountBasicInformation accountInformation)
fun updateAccountBasicInformation(@NonNull accountInformation:UpdateAccountBasicInformation):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| accountInformation | UpdateAccountBasicInformation | yes | - | Builder Pattern object with the Customer's basic account information |
Return Value:
IApiCall object to execute the request.
Example:
if (apiCall != null) apiCall.cancel();
apiCall = Client.updateAccountBasicInformation(accountInformation);
apiCall.execute(this::onSuccess, this::onFailure);
if (apiCall != null) apiCall.cancel()
apiCall = Client.updateAccountBasicInformation(accountInformation)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Update customer account information
This method updates a customer’s account information.
This method requires the context object with the customer’s account information. Omitted fields are not modified.
This method requires customer authentication.
The API key must have the API_PERSONAL_INFORMATION_CLIENT_UPDATE permission from the Client group.
Method name:
Client.updateAccount(accountInformation)
Declaration:
public static IApiCall updateAccount(@NonNull UpdateAccountInformation accountInformation)
fun updateAccount(@NonNull accountInformation:UpdateAccountInformation):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| accountInformation | UpdateAccountInformation | yes | - | Builder Pattern object with the Customer's account information |
Return Value:
IApiCall object to execute the request.
Example:
if (apiCall != null) apiCall.cancel();
apiCall = Client.updateAccount(accountInformation);
apiCall.execute(this::onSuccess, this::onFailure);
if (apiCall != null) apiCall.cancel()
apiCall = Client.updateAccount(accountInformation)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Change customer's account password
This method changes a customer’s password.
This method requires customer authentication.
Returns the HTTP 403 status code if the provided old password is invalid.
The API key must have the SAUTH_CHANGE_PASSWORD_CLIENT_UPDATE permission from the Client group.
Method name:
Client.changePassword(oldPassword, password)
Declaration:
public static IApiCall changePassword(@NonNull String oldPassword, @NonNull String password)
fun changePassword(@NonNull oldPassword:String, @NonNull password:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| oldPassword | String | yes | - | Client's old password |
| password | String | yes | --- | Client's new password |
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall apiCall;
if (apiCall != null) apiCall.cancel();
apiCall = Client.changePassword(oldPassword, password);
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
if (apiCall != null) apiCall.cancel()
apiCall = Client.changePassword(oldPassword, password)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Request password reset for customer account
This method requests a customer’s password reset with email. The customer will receive a token to the provided email address. That token is then used for the confirmation of password reset.
This method requires the customer’s email.
This method is a global operation and doesn't require customer authentication.
The API key must have the SAUTH_PASSWORD_RESET_CLIENT_CREATE permission from the Client group.
Method name:
Client.requestPasswordReset(resetRequest)
Declaration:
public static IApiCall requestPasswordReset(@NonNull PasswordResetRequest resetRequest)
fun requestPasswordReset(@NonNull resetRequest:PasswordResetRequest):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| resetRequest | PasswordResetRequest | yes | - | PasswordResetRequest object with the Client's email. |
Return Value:
IApiCall object to execute the request.
Example:
if (call != null) call.cancel();
call = Client.requestPasswordReset(new PasswordResetRequest(email));
EspressoTestingIdlingResource.increment();
call.execute(this::onSuccess, this::onFailure);
if (call != null) call.cancel()
call = Client.requestPasswordReset(PasswordResetRequest(email))
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Confirm password reset for customer account
This method confirm a customer’s password reset with the new password and token provided by password reset request.
This method requires the customer’s new password and the confirmation token received by e-mail.
This method is a global operation and doesn't require customer authentication.
The API key must have the SAUTH_PASSWORD_RESET_CLIENT_CREATE permission from the Client group.
Method name:
Client.confirmPasswordReset(resetConfirmation)
Declaration:
public static IApiCall confirmPasswordReset(@NonNull PasswordResetConfirmation resetConfirmation)
fun confirmPasswordReset(@NonNull resetConfirmation:PasswordResetConfirmation):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| resetConfirmation | PasswordResetConfirmation | yes | - | PasswordResetConfirmation object with the Client's new password and confirmation token. |
Return Value:
IApiCall object to execute the request.
Example:
private IApiCall call;
if (call != null) call.cancel();
call = Client.confirmPasswordReset(confirmation);
call.execute(this::onSuccess, this::onFailure);
val call:IApiCall
if (call != null) call.cancel()
call = Client.confirmPasswordReset(confirmation)
call.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Request email change for customer account
This method requests a customer's email change.
This method is a global operation and doesn't require customer authentication.
Returns the HTTP 403 status code if the provided token or the password is invalid.
The API key must have the SAUTH_CHANGE_EMAIL_CLIENT_UPDATE permission from the Client group.
Method name:
Client.requestEmailChange(email, password, externalToken, authId)
Declaration:
public static IApiCall requestEmailChange(String email, String password, @Nullable String externalToken, @Nullable String authId)
fun requestEmailChange(email:String, password:String, @Nullable externalToken:String, @Nullable authId: String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| String | yes | - | Customer's email | |
| password | String | yes | - | Customer's password |
| externalToken | String | no | - | ExternalToken should be used for Facebook, Oauth. For Synerise account, pass null |
| authId | String | no | - | Optional identifier of authorization. For Synerise account, pass null. |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall apiCall;
apiCall = Client.requestEmailChange(email, password, null, null);
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
apiCall = Client.requestEmailChange(email, password, null, null)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Confirm email change for customer account
This method confirms an email change.
This method is a global operation and doesn't require customer authentication.
Returns the HTTP 403 status code if the provided token is invalid.
The API key must have the SAUTH_CHANGE_EMAIL_CLIENT_UPDATE permission from the Client group.
Method name:
Client.confirmEmailChange(token, newsletterAgreement)
Declaration:
public static IApiCall confirmEmailChange(String token, boolean newsletterAgreement)
fun confirmEmailChange(token:String, newsletterAgreement:Boolean):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| token | String | yes | - | Token from customer's email |
| newsletterAgreement | boolean | yes | - | Newsletter agreement |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall apiCall;
apiCall = Client.confirmEmailChange(token, newsletterAgreement.isChecked());
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
apiCall = Client.confirmEmailChange(token, newsletterAgreement.isChecked())
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Request phone update on customer account
This method requests a customer's phone update. A confirmation code is sent to the phone number.
This method is a global operation and doesn't require customer authentication.
The API key must have the API_PERSONAL_PHONE_CLIENT_CREATE permission from the Client group.
Method name:
Client.requestPhoneUpdate(phone)
Declaration:
public static IApiCall requestPhoneUpdate(String phone)
fun requestPhoneUpdate(phone:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| phone | String | yes | - | Customer's phone number. |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall apiCall;
apiCall = Client.requestPhoneUpdate(phone);
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
apiCall = Client.requestPhoneUpdate(phone)
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Confirm phone update on customer account
This method confirms a phone number update. This action requires the new phone number and confirmation code as parameters.
This method is a global operation and doesn't require customer authentication.
Returns the HTTP 403 status code if the provided UUID does not exist or the password is invalid.
The API key must have the API_PERSONAL_PHONE_CLIENT_CREATE permission from the Client group.
Method name:
Client.confirmPhoneUpdate(phone, confirmationCode, smsAgreement)
Declaration:
public static IApiCall confirmPhoneUpdate(String phone, String confirmationCode, @Nullable Boolean smsAgreement)
fun confirmPhoneUpdate(phone:String, confirmationCode:String, @Nullable smsAgreement:Boolean):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| phone | String | yes | - | Phone number that will be confirmed |
| confirmationCode | String | yes | - | Code received in SMS |
| smsAgreement | Boolean | no | - | Optional SMS marketing agreement |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall apiCall;
apiCall = Client.confirmPhoneUpdate(phone, code, enableAgreement.isChecked() ? null : smsAgreement.isChecked());
apiCall.execute(this::onSuccess, this::onFailure);
val apiCall:IApiCall
apiCall = Client.confirmPhoneUpdate(phone, code, if (enableAgreement.isChecked()) null else smsAgreement.isChecked())
apiCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Delete customer account by Identity Provider
This method deletes a customer's account.
This method requires customer authentication.
HTTP 403 status code is returned if the provided password or token is invalid.
The API key must have the SAUTH_CLIENT_DELETE, SAUTH_OAUTH_CLIENT_DELETE, SAUTH_FACEBOOK_CLIENT_DELETE, SAUTH_APPLE_CLIENT_DELETE permissions from the Client group.
Method name:
Client.deleteAccount(clientAuthFactor, clientIdentityProvider, authId)
Declaration:
public static IApiCall deleteAccount(String clientAuthFactor, ClientIdentityProvider clientIdentityProvider, @Nullable String authId)
fun deleteAccount(clientAuthFactor:String, clientIdentityProvider:ClientIdentityProvider, authId:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| clientAuthFactor | String | yes | - | In case of oauth, fb, or google this is token. If you have synerise account this is password. |
| clientIdentityProvider | ClientIdentityProvider | yes | - | Provider of your account. Example: FACEBOOK, OAUTH, SYNERISE, GOOGLE |
| authId | String | no | - | Customer's optional unique identifier |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall deleteCall = Client.deleteAccount(password, ClientIdentityProvider.SYNERISE, null);
deleteCall.execute(this::onSuccess, this::onFailure);
val deleteCall = Client.deleteAccount(password, ClientIdentityProvider.SYNERISE, null)
deleteCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Removed methods
Delete customer account
This method deletes a customer's account.
This method requires customer authentication.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| Deprecated in: | 3.6.19 | 3.6.19 | 0.14.0 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | n/a | n/a |
Returns the HTTP 403 status code is returned if the provided password is invalid.
The API key must have the SAUTH_CLIENT_DELETE permission from the Client group.
Replaced By:
Delete customer account by Identity Provider
Method name:
Client.deleteAccount(password)
Declaration:
public static IApiCall deleteAccount(String password)
fun deleteAccount(password:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| password | String | yes | - | Customer's current password. |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall deleteCall = Client.deleteAccount(password);
deleteCall.execute(this::onSuccess, this::onFailure);
val deleteCall = Client.deleteAccount(password)
deleteCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Delete customer account by OAuth
This method deletes a customer's account by OAuth.
This method requires customer authentication.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| Deprecated in: | 3.6.19 | 3.6.19 | 0.14.0 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | n/a | n/a |
The API key must have the SAUTH_CLIENT_DELETE and SAUTH_OAUTH_CLIENT_DELETE permissions from the Client group.
Replaced By:
Delete customer account by Identity Provider
Method name:
Client.deleteAccountByOAuth(accessToken, uuid)
Declaration:
public static IApiCall deleteAccountByOAuth(String accessToken, @Nullable String uuid)
fun deleteAccountByOAuth(accessToken:String, @Nullable uuid:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| accessToken | String | yes | - | user's token |
| uuid | String | no | --- | Optional Customer UUID, internal UUID is used if this parameter is null |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall deleteCall = Client.deleteAccountByOAuth(accessToken, uuid)
deleteCall.execute(this::onSuccess, this::onFailure);
val deleteCall = Client.deleteAccountByOAuth(accessToken, uuid)
deleteCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))
Delete customer account by Facebook
This method deletes a customer's account by Facebook.
This method requires customer authentication.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.3.8 | 3.3.0 | 0.9.12 | n/a |
| Deprecated in: | 3.6.19 | 3.6.19 | 0.14.0 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | n/a | n/a |
The API key must have the SAUTH_CLIENT_DELETE and SAUTH_FACEBOOK_CLIENT_DELETE permissions from the Client group.
Replaced By:
Delete customer account by Identity Provider
Method name:
Client.deleteAccountByFacebook(facebookToken, uuid)
Declaration:
public static IApiCall deleteAccountByFacebook(String facebookToken, @Nullable String uuid)
fun deleteAccountByFacebook(facebookToken:String, @Nullable uuid:String):IApiCall
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| facebookToken | String | yes | - | Customer's facebook token |
| uuid | String | no | --- | Optional Customer UUID, internal UUID is used if this parameter is null |
Return Value:
IApiCall object to execute the request.
Example:
IApiCall deleteCall = Client.deleteAccountByFacebook(facebookToken, uuid)
deleteCall.execute(this::onSuccess, this::onFailure);
val deleteCall = Client.deleteAccountByFacebook(facebookToken, uuid)
deleteCall.execute(({ this.onSuccess() }), ({ this.onFailure() }))