Rtype
Rtype

Reputation: 915

Teams user profile image access via Microsoft teams bot

I'm currently learning the Microsoft teams system and the bot framework V4. One goal I have is to be able to access the all of the team members profile pictures as part of the project.

I'm having a lot of difficulty accessing the images. I'm trying to use OAuth card when a user talks to the bot and then use the returned token to access the Microsoft graph. One issues with this method is that if I want to access fresh versions of people profile pictures I will have to Auth someone each time i want to refresh?

Am I going the correct way about this or is there a simpler way to access the Microsoft graph from a bot once installed in a tenant?

Upvotes: 2

Views: 2432

Answers (1)

There are multiple ways of going about this. What I understand from your problem statement is that you want to be able to fetch profile pictures of team members in a team where the bot is added.

This is a multiple step process. Following are the steps involved in this :

  1. Fetch all team members using the conversation ID and team roster
  2. Using all the email IDs, use Microsoft GraphAPI to fetch user profile information like profile pictures
  3. If you donot want to send OAuth card to the end user again and again, you can register your application in your Azure AD and use Application permissions instead of delegate permissions to access GraphAPI

Feel free to revert, if I misunderstood your problem.

Upvotes: 1

Related Questions