How to get user information from MS Teams to our rasa chatbot?

Hello @community @Rasa… Am new on rasa and i want to know how to get Microsoft team’s user’s data like user’s name, email, id and etc to our Rasa Chatbot? Thanks in advance. Regards, Yash

@Yash_kals - Did you find a way… if yes could you please share it here

Hi can share you how you can get rhe user name.

just replace id with name so now the sender id will be name of the user or if you want to get id and username both then make sender list or dict in channel.py.

Here are some modification in the code if you want to find out user id , email , and name. Follow the steps given below.

  1. modify botframework.py here are the modifying botframework in which i have add one extra method to get the user infomation.

botframework.py (9.4 KB) after this add the following code in your in actions.py user_information_str = tracker.sender_id user_information_str_dict = eval(user_information_str) username = user_information_str_dict.get(“name”) email = user_information_str_dict.get(“email”) user_id = user_information_str_dict.get(“id”) if it help you hit a like.

2 Likes

@kuldeep Thank you so much Kuldeep - It works

Thanks for the appreciation. May I know what are you working on.

hello,

I changed the botframework.py file but I am getting an error like this. how can i solve it?

Hi @kuldeep , I’ve used the botframework.py file provided by you and I’ve pasted the lines provided by you in my actions.py file. However, in the following - username = user_information_str_dict.get(“name”) email = user_information_str_dict.get(“email”) user_id = user_information_str_dict.get(“id”)

‘name’,‘email’ and user_id’ are not getting recognized by Python. basically, python is failing to understand where and how these are coming here. Please help me.

@nik202 , Sir, if you could help me out here it would be great

Hi @webdev-rohit, I’m here for help only but now limited. I’m afraid in not did much worked on MS Teams.

Okay @nik202 not a problem. Thank you

hi @nik202 , could you please help me in knowing that is it possible to add sso to the rasa chatbot deployed on ms teams?

@akshayagrawal927 thanks for the tag, but I have no idea of MS Teams integration. Please see other forum posts maybe you will find some solution. Good Luck! AA.

Thanks for the reply @nik202

@akshayagrawal927 no worries.