Thanks for checking that out, @david. Prompted me to see if I could ‘fetch’ it into the user JSON, appears the OData expand query parameter isn’t supported for the photo though - which does come through as a URL if you append /$value to it:
…you cannot use
$expandon theuser/photorelationship.
I couldn’t figure out a way to reverse that; so instead of https://graph.microsoft.com/beta/me?$expand=photo going something like https://graph.microsoft.com/beta/me/photo/$value?$expand=mail,displayName. Splutter, toys out of pram, rant.
Perhaps we could use the ‘mail’ location in the JSON data to construct the URL to the photo, which is consistently:
https://tenant-my.sharepoint.com/User%20Photos/Profile%20Pictures/adam_pope_arup_com_LThumb.jpg
..so could we concatenate the three elements in the field with the right syntax? My numpty attempt here didn’t work, unsurprisingly:
“https://tenant-my.sharepoint.com/User%20Photos/Profile%20Pictures/” & mail & “_LThumb.jpg”
…or maybe another way - I’m clearly grasping at straws here - would be to add the photo endpoint to the oauth2 user json url field with something like:
https://graph.microsoft.com/v1.0/me?https://graph.microsoft.com/v1.0/me/photo