question

scottwtang avatar image
0 Votes"
scottwtang asked scottwtang edited

Sending Teams message with attachment works with any attachment ID

When using the Graph API to send a Teams message, as seen in example 4 in the documentation, the documentation notes that the attachment ID should be the eTag GUID of the driveItem.
However, I've successfully sent a HTTP request as below, using the attachment ID as 12345678-1234-1234-1234-123456789123 (without changing). It seems any attachment ID works

URI

 https://graph.microsoft.com/v1.0/chats/19:00000000-0000-0000-0000-10b6e04b39b9_8388322d-0000-0000-0000-7401c360f83f@unq.gbl.spaces/messages

Method

 POST

Headers

 Authorization: Bearer {access_token}
 Content-type: application/json

Body

 {
     "body": {
         "contentType": "html",
         "content": "Test message <attachment id=\"12345678-1234-1234-1234-123456789123\"></attachment>"
     },
     "attachments": [
         {
             "id": "12345678-1234-1234-1234-123456789123",
             "contentType": "reference",
             "contentUrl": "https://domain.sharepoint.com/Shared%20Documents/test.xml",
             "name": "test.xml"
         }
     ]
 }



microsoft-graph-teamworkmicrosoft-graph-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers