Auto Fill User Details using Kaizala

In this post, we will talk about how we can access group and user user details of the current logged in user in a custom action card. This can be useful to autofill user details like phone number, user name etc. already known by Kaizala. This prevents the user from manually taking the effort to type in these details. 

Extracting group and Kaizala user details 

Profile Card Screenshot

 

We will take an example of a profile card where user details are filled automatically. To achieve this we will be calling two APIs –getConversationDetailsAsync and getUsersDetailsAsync.

Following is a sample usage of these two APIs

getConversationDetailsAsync and getUsersDetailsAsync usage

“groupDetails” here will receive a bunch of information about the group. 

Response returned by KASClient.App.getConversationDetailsAsync

“currentUserInfo” contains details more specific to the logged in user. 

Response returned by getUserDetailsAsync

Extracting O365 details of user 

You can sign in to your O365 office account by selecting “Linked Accounts” in Kaizala “Profile” tab and then clicking on “Sign-in with Office 365 account” .  

Note: Pre-requisites for signing in to O365 account include Microsoft Authenticator App and the Intune Company Portal App both provided by Microsoft. This is available on PlayStore as well as AppleStore. 

You can check if a user is signed in to his O365 account using the isCurrentUserO365SubscribedAsync API which returns true/false depending on whether he is signed in or not. If he is signed in you can receive his O365 details by calling the getO365UserDetailsAsync API. 

isCurrentUserO365SubscribedAsync and getO365UserDetailsAsync API usage 

For a user who has not signed into his O365 account using Kaizala, we print a “User has not signed in” message. Apart from email and job title, there are many other details provided by getO365DetailsAsync API like his mobilePhoneNumber, businessPhone, jobTitle in company etc.

You can find the profile card code which uses all these APIs here

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s