how do I access the personal information on groovy?

1
0
-1

I need to get the personal email from a user, I can access to this info through the api on UI Designer but I can't on groovy, what's the method to access it?

I have tried identityApi.getUserContactData but it only shows the contact email and I have tried identityApi.getUser but it doesn't appear an Email method for me

1 answer

1
0
-1

Hi rogoca,

On a groovy script you would be using the Java APIs: https://documentation.bonitasoft.com/bonita/latest/api/engine-api-overview

In order to make it simpler, when you open the script editor on Bonita Studio, on the left you can double-click on "Code Templates" > "Bonita Users" > "userPersonalContact". This will result in adding the following code to your script which will allow you to access your user data based on the userId:

def personalContactData = apiAccessor.getIdentityAPI().getUserContactData(userId, true)

It is the equivalent of this call done by the UIDesigner: https://api-documentation.bonitasoft.com/latest/#tag/ProfessionalContact...

Hope this helps!

-Thalía

Comments

Submitted by rogoca on Thu, 04/25/2024 - 13:21

hello,

thanks for the answer, I tested this but this gives me business card information, not personal information, on the bonita administration application I have business card and personal information, this solution gives me the business card data and not personal information, how do I access this?

Notifications