Customer session

Refresh customer token


This method refreshes the customer’s current token.

This method requires customer authentication.

Note: Returns an error if the customer is not logged in or the token has expired and cannot be refreshed.

Method name:
Client.refreshToken()

Declaration:

public static IApiCall refreshToken()

Parameters:
No parameters required.

Return Value:
IApiCall object to execute the request.

Example:

boolean success = Client.refreshToken();

Retrieve customer token


This method retrieves the customer’s current, active token.

This method requires customer authentication.

Note: Returns an error if the customer is not logged in or the token has expired and cannot be refreshed.

Method name:
Client.getToken()

Declaration:

public static IDataApiCall<Token> getToken()

Parameters:
No parameters required.

Return Value:
IDataApiCall<Token> object to execute the request.

Example:

IDataApiCall getTokenCall = Client.getToken();
        getTokenCall.execute(success -> onSuccess(), this::onFailure);

Get current customer UUID


This method retrieves the customer’s current UUID.

Method name:
Client.getUuid()

Declaration:

public static String getUuid()

Parameters:
No parameters required.

Return Value:
Customer’s UUID as a string.

Example:

Client.getUuid()

Regenerate customer


This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.

This operation works only if the customer is anonymous.

Method name:
Client.regenerateUuid()

Declaration:

public static boolean regenerateUuid()

Parameters:
No parameters required.

Return Value:
Returns true if the current Customer is anonymous and the operation succeeds.

Example:

boolean success = Client.regenerateUuid();

Regenerate customer with identifier


This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.

The optional clientIdentifier parameter is a seed for UUID generation.

Note: This operation works only if the customer is anonymous.

Method name:
Client.regenerateUuid(clientIdentifier)

Declaration:

public static boolean regenerateUuid(clientIdentifier)

Parameters:

Parameter Type Mandatory Description
clientIdentifier String no Seed for UUID generation
Note: The clientIdentifier parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

Return Value:
Returns true if the current Client is anonymous and the operation succeeds.

Example:

boolean success = Client.regenerateUuid(clientIdentifier);

Destroy current session


This method destroys the whole session completely.

Method name:
Client.destroySession()

Declaration:

public static void destroySession()

Parameters:
No parameters required.

Return Value:
Method is void type.

Example:

Client.destroySession();

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker