Skip to content

AnnA Corporate User

Anna Corporate User is a resource that makes possible for you to create corporate users and generate an authentication hash for the specified user

Using AnnaCorporateUserClient class

This class will provide you methods to create, update or inactivate a corporate user in AnnA.

Example:

AnnaCorporateUserClient corporateUserClient = new AnnaCorporateUserClient("YOUR_ANNA_ENVIRONMENT_BASE_URL",
AnnaCorporateUserClientConfig.builder()
.companyHash("YOURCOMPANYHASH")
.encryptionKey("YOUR_CORPORATEUSER_ENCRYPTION_KEY")
.decryptionKey("YOUR_CORPORATEUSER_DECRYPTION_KEY")
.build()
);

Generate user hash

This method generates a hash for AnnA Embedded Chat authentication.

// If you don't want to select a start service, pass null
String response = corporateUserClient.generateUserHash("YOUR_CORPORATE_USER_ID", "@START_SERVICE");

Update/Create user

This method update/insert a corporate user in AnnA and generates a hash for AnnA Embedded Chat authentication.

CorporateUser user = CorporateUser.builder()
.userId("USER_ID")
.userName("USERNAME") // This is the information that will be updated
.build();
// If you don't want to select a start service, pass null
String response = corporateUserClient.upsertCorporateUser(user, "@START_SERVICE");

Inactivate user

This method inactivates a corporate user in AnnA

String response = corporateUserClient.inactivateUser("USER_ID");