Azure / Microsoft365R

R SDK for interacting with Microsoft 365 APIs
Other
311 stars 43 forks source link

inline images in channel message not accessible #165

Closed jessekps closed 1 year ago

jessekps commented 1 year ago

I have created a message in teams. In the message I pasted an image from the clipboard. In teams the message looks fine. When I access the message in R I see an image in the source:

msg = channel$list_messages()[[1]]

cat(msg$properties$content$body)

>  <div><span><img height="250" src="https://graph.microsoft.com/beta/teams/fe42c.....

but I cannot download this image. If I paste the msg$webUrl in the browser, I get redirected to teams and it looks ok, so I obviously have access I would think. However, when I copy the url of the image in the browser I get the following response:

{"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty.",
   "innerError":{"date":"2023-06-06T07:52:24",
   "request-id":"db016e7...","client-request-id":"db016e7..."}}}

Is this a bug or is there some other way to access this image outside of teams?

hongooi73 commented 1 year ago

Nothing to do with R, or with this package. This is about how the server sets the content-type of the returned data.