GRAPH: Retrieve Image from Microsoft List via Graph
Hello,
I have integrated a Microsoft list with Graph. I can read and write List Items. I am also seeing the field "DevicePhoto" while retrieving the items of the list:
"DevicePhoto": "{\"type\":\"thumbnail\",\"fileName\":\"name.jpg\",\"nativeFile\":{},\"fieldName\":\"DevicePhoto\",\"serverUrl\":\"https://name.sharepoint.com\",\"fieldId\":\"...\",\"serverRelativeUrl\":\"/sites/.../SiteAssets/Lists/.../name.jpg\",\"id\":\"...\"}",
If i assemble the url from serverUrl and serverRelativeUrl I can view the image via an authenticated browser. However, when I request this url via eg. postman with my AccessToken I get 401 unauthorized.
I am creating my AccessToken with the following permissions (openid profile offline_access Chat.ReadWrite User.Read.All ChannelMessage.Send ChannelMessage.Read.All Team.ReadBasic.All Channel.ReadBasic.All Channel.create Team.Create TeamMember.ReadWrite.All GroupMember.Read.All Group.Read.All Sites.ReadWrite.All Calendars.ReadBasic)
I also tried to reach for the drive where the images are stored but I cannot access the one with the siteAssets.
What is the best way to query the DevicePhoto from an App registration?
Thank you very much for your help!!
Jens