Post Image from SharePoint via Webhook

Comanescu Orlando TMS DIWRS21 0 Reputation points
2023-01-16T14:56:07.78+00:00

Hello all,

I am trying to use a webhook for one of the Teams Channels to post some graphics.

Please let me know how I can properly do it since I used the following code:

# message = {
#    "type":"message",
#    "attachments":[
#       {
#         "contentType": "application/vnd.microsoft.card.hero",
#         "content": {
#             "title": "Test",
#             "images": [
#             {
#                 "url": "https://cdn2.iconfinder.com/data/icons/infographic-bar-vol-9-1/512/1-512.png" } ]
#             }
#       }
#    ]
#   }


# # Define the headers
# headers = { 'Content-Type': 'application/json' }

# # # Make the request
# response = requests.post(url, verify = False, json=message, headers=headers)

And it adds the photo but if I change the URL to a Public SharePoint link, the result will be the follwing:

User's image

Regarding the final result I would be interested how to activate the enlarge feature, if I select the photo to be able to see it enlarged.

Thank you very much.

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.