13,721 questions
Sending Teams message with attachment works with any attachment ID
scottwtang
1
Reputation point
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:******@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 Security Microsoft Graph
Sign in to answer