I receive an Activity from Microsoft Teams.
The file ID I use to make the API call is the one in value.attachments[0].id
I know I have a downloadUrl in this activity but it's not always the case
{
"name": "composeExtension/fetchTask",
"type": "invoke",
"timestamp": "2023-01-30T12:42:48.946Z",
"localTimestamp": "2023-01-30T08:42:48.946-04:00",
"id": "f:2985c764-36f3-6ec4-116f-152f196fafd4",
"channelId": "msteams",
"serviceUrl": "https://smba.trafficmanager.net/amer/",
"from": {
"id": "29:1JiEH1nLmzqH5YT7Do_1KRCs7ISDxUmVVKPbIzwM1pc884QpFbzi7GFznE58JZKe5sdjw65yzjAZtxyJt55B3mA",
"name": "Benoit Dupont",
"aadObjectId": "af24b8a2-cfe8-453a-a9b4-4a917b1534ae"
},
"conversation": {
"conversationType": "personal",
"tenantId": "caafef10-9d12-4668-a0d6-268b71695e1a",
"id": "a:1ktMfOkUqtyhd4ub9GhZwaOdqpjjygWz5IZGvHZLTCnduBU1HmsFGO9vBAMZMQhqJOeiphjhE_k9G3HerhrBgeIf6uuA-FYRX93w_OsJYVTFX1lB36Q5xJgAGJtizZM1o"
},
"recipient": {
"id": "28:45fc30f1-94c5-48aa-b0df-ef0e41b65c6c",
"name": "XM Fax"
},
"entities": [
{
"locale": "en-CA",
"country": "CA",
"platform": "Web",
"timezone": "America/Halifax",
"type": "clientInfo"
}
],
"channelData": {
"tenant": {
"id": "caafef10-9d12-4668-a0d6-268b71695e1a"
},
"source": {
"name": "compose"
}
},
"value": {
"commandId": "share-by-fax",
"commandContext": "message",
"requestId": "a3071327-d6c0-48b2-9523-1cf19f92b5e9",
"messagePayload": {
"linkToMessage": "https://teams.microsoft.com/l/message/19:af24b8a2-cfe8-453a-a9b4-4a917b1534ae_45fc30f1-94c5-48aa-b0df-ef0e41b65c6c@unq.gbl.spaces/1675081945447?context=%7B%22contextType%22:%22chat%22%7D",
"id": "1675081945447",
"replyToId": null,
"createdDateTime": "2023-01-30T12:32:25.447Z",
"lastModifiedDateTime": null,
"deleted": false,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"body": {
"contentType": "html",
"content": "<attachment id=\"666296e5-4242-4f06-a050-ee38b449b76a\"></attachment>"
},
"from": {
"device": null,
"conversation": null,
"user": {
"userIdentityType": "aadUser",
"id": "af24b8a2-cfe8-453a-a9b4-4a917b1534ae",
"displayName": "Benoit Dupont"
},
"application": null
},
"reactions": [],
"mentions": [],
"attachments": [
{
"id": "666296e5-4242-4f06-a050-ee38b449b76a",
"contentType": "reference",
"contentUrl": "https://xxwdq-my.sharepoint.com/personal/adm_xxwdq_onmicrosoft_com/Documents/Microsoft Teams Chat Files/PDF (1).PDF",
"content": null,
"name": "PDF (1).PDF",
"thumbnailUrl": null
}
]
},
"context": {
"theme": "default"
}
},
"locale": "en-CA",
"localTimezone": "America/Halifax"
}