SOLVED

How do you programmatically get the profile image that Teams uses in chat?

%3CLINGO-SUB%20id%3D%22lingo-sub-2249458%22%20slang%3D%22en-US%22%3EHow%20do%20you%20programmatically%20get%20the%20profile%20image%20that%20Teams%20uses%20in%20chat%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249458%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20my%20company%20Teams%20instance%2C%20I%20noticed%20that%20my%20chat%20messages%2C%20and%20those%20of%20my%20colleague%2C%20all%20have%20profile%20images.%20However%2C%20when%20I%20log%20in%20to%20Teams%20or%20go%20to%20My%20Account%20(%3CA%20href%3D%22https%3A%2F%2Fmyaccount.microsoft.com%2F%3Fref%3DMeControl%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmyaccount.microsoft.com%2F%3Fref%3DMeControl%3C%2FA%3E)%20I%20do%20not%20have%20a%20profile%20picture%20set.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20reason%20I'm%20asking%20is%20I'm%20writing%20a%20Bot%20Framework%20v4%20Bot%20and%20I%20want%20to%20access%20the%20profile%20pic%20of%20the%20user%20sending%20my%20bot%20a%20message.%20However%2C%20when%20I%20use%20the%20Graph%20API%20(%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fphoto%2F%24value%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fphoto%2F%24value%3C%2FA%3E)%3C%2FSPAN%3E%2C%20I%20get%20the%20photo%20is%20not%20found.%20Well%20that%20makes%20sense%2C%20I%20do%20not%20appear%20to%20have%20a%20photo%20according%20to%20Azure%20AD.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I'd%20like%20to%20understand%20where%20does%20Teams%20get%20its%20profile%20pic%20and%20how%20do%20I%20access%20that%20from%20my%20bot%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2249458%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBots%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

In my company Teams instance, I noticed that my chat messages, and those of my colleague, all have profile images. However, when I log in to Teams or go to My Account (https://myaccount.microsoft.com/?ref=MeControl) I do not have a profile picture set.

 

The reason I'm asking is I'm writing a Bot Framework v4 Bot and I want to access the profile pic of the user sending my bot a message. However, when I use the Graph API (https://graph.microsoft.com/v1.0/me/photo/$value), I get the photo is not found. Well that makes sense, I do not appear to have a photo according to Azure AD.

 

So I'd like to understand where does Teams get its profile pic and how do I access that from my bot?

1 Reply
best response confirmed by ThereseSolimeno (Microsoft)
Solution
So I tried this with the Beta API and I got the photo! https://graph.microsoft.com/beta/me/photo/$value