FILE ATTACHMENT API

SHABIN TC 0 Reputation points
2023-09-13T09:25:26.4533333+00:00

Hi,
I'm encountering an issue with file attachments in Microsoft Teams. The attachment process is successful, but my customer requires image file previews.

I've attached files from OneDrive to Teams, and it's working well for other file types. However, when I attach an image, it doesn't display a preview. Users can receive, download, and copy the link, but the preview is missing.

Below is the data for my API request body. Any solutions?

{
          "body": {
              "contentType": "html",
              "content": "Here's the latest budget. <attachment id=\"153fa47d-18c9-4179-be08-9879815a9f90\"></attachment>"
          },
          "attachments": [
              {
                  "id": "153fa47d-18c9-4179-be08-9879815a9f90",
                  "contentType": "reference",
                  
                  "name": "screenshot.png",
                  "thumbnailUrl" : "https://southindia1-mediap.svc.ms/transform/thumbnail?provide..." 
              }
          ]
      }
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,850 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,724 questions
{count} votes

Your answer

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