Get images from channel messages content in Teams

I need to read channel messages, including pasted images (not attachments).

I have already configured my activities inside a Microsoft Teams Scope with application id, tenant id and windows authentication and I was able to read the messages, but without images.

The content of such message (ChatMessage.Body.Content) contains the URL where the image can be downloaded:

https://graph.microsoft.com/beta/teams/{teamId}/channels/{channelId}/messages/{messageId}/hostedContents/{contentId}/$value

I was able to download the image using Postman.

There is not built-in activity There is not built-in activity in UiPath for getting the images.

If I could get the access token I would be able to get it by making a HTTP request. But I don’t know how to get it.

How can I download these images from UiPath? Any ideas?

Can’t you automate the action to right click on image , save image and then save it to disk?

If that isn’t practical, this link may help:

No… I would prefer to save images without GUI interaction and I don’t know how to get the access token in order to do HTTP requests to Graph APi

Yes but did you see if that article I posted a link helps you? There seems to be several samples on that page that may show you how.

You may want to look up basics of APIs in general on how to authenticate and fetch tokens. Usually your credentials will be your domain login and password which is also your work account that you use to login to Enterprise teams.

Thanks