Is there a way to get the teams url message created by incoming webhook ?

cfrapper 1 Reputation point
2022-05-29T16:06:03.493+00:00

Hello, here is what I'm trying to achieve ;
I have configured an incoming webhook and it is working fine, but I'm wondering if there is a way to get the teams url of the message created by the webhook ? In the response for example ?

Or, is there a way in the incoming webhook to mention an outgoing webhook, I know we can mention user in adaptative card in incoming webhook but seems like it is impossible to mention my outgoing webhook.

Does anyone have a solution ?

Colin

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
{count} votes

1 answer

Sort by: Most helpful
  1. Nivedipa-MSFT 3,946 Reputation points Microsoft External Staff Moderator
    2022-06-02T08:43:20.947+00:00
    1. You can get the List channel messages using below graph API:

    GET /teams/{team-id}/channels/{channel-id}/messages

    Response of this graph API contains the webURL of the message.

    HTTP/1.1 200 OK
    Content-type: application/json

    {
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('fbe2bf47-16c8-47cf-b4a5-4b9b187c508b')/channels('19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2')/messages",
    "@odata.count": 3,
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/teams/fbe2bf47-16c8-47cf-b4a5-4b9b187c508b/channels/19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2/messages?$skiptoken=%5b%7B%22token%22%3a%22%2bRID%3a~vpsQAJ9uAC047gwAAACcBQ%3d%3d%23RT%3a1%23TRC%3a20%23RTD%3aAyAER1ygxSHVHGAn2S99BTI6OzViOjZnOGU5ZWM1ZDVmOGdiZjk2OGNkZmNmMTczNGY3QXVpc2ZiZS91YmR3MzwyNzIyNDY2OTU0NTg6AA%3d%3d%23ISV%3a2%23IEO%3a65551%23QCF%3a3%23FPC%3aAggEAAAAcBYAABUFAADQKgAABAAAAHAWAAACALu4GwAAAHAWAAACAPSTMwAAAHAWAACaAFWa84BXgQKAEIAMgBaAE4AUgAuAAoAIwAIgACAAAiAACAABACCAAAEVgBSAI4AYgA%2bAGQAEEAAQAAEABACAAAIEEBBAACAYgB%2bAH4AbgBqACoAHwAICCBAEEIAAAgEQAACAIoAZgB2ADoAMgAKAPoAZgB2AJoAXgBIAgiAAQUqLF4AJgALACARAgBCACoAfgB6AIwABgYCQAAFXAAAAcBYAAAYA%2f50ZgGeEXwAAAHAWAAAEAPaBS4V7AAAAcBYAAAIA1aSJAAAAcBYAAAIAtLmbAAAAcBYAAAIAqKXdAAAAcBYAAAQAppUugOMAAABwFgAABADQoAWA6wAAAHAWAAAEABGl94M5AAAA0CoAAAYA6pF7iYOBaQIAANAqAAAcAEUPAMAAMAACAQCBAHQAADDAgCAAQgByAQAzUJDRBAAA0CoAAAQAETwKAA4FAADQKgAAAgBekRUFAADQKgAAHAB2pQCABYAMgJeAH4ATgAGAvIIIgASABIAFgCWA%22%2c%22range%22%3a%7B%22min%22%3a%2205C1D79B33ADE4%22%2c%22max%22%3a%2205C1D7A52F89EC%22%7D%7D%5d",
    "value": [
    {
    "id": "1616965872395",
    "replyToId": null,
    "etag": "1616965872395",
    "messageType": "message",
    "createdDateTime": "2021-03-28T21:11:12.395Z",
    "lastModifiedDateTime": "2021-03-28T21:11:12.395Z",
    "lastEditedDateTime": null,
    "deletedDateTime": null,
    "subject": null,
    "summary": null,
    "chatId": null,
    "importance": "normal",
    "locale": "en-us",
    "webUrl": "https://teams.microsoft.com/l/message/19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2/1616965872395?groupId=fbe2bf47-16c8-47cf-b4a5-4b9b187c508b&tenantId=2432b57b-0abd-43db-aa7b-16eadd115d34&createdTime=1616965872395&parentMessageId=1616965872395",
    "policyViolation": null,
    "eventDetail": null,
    "from": {
    "application": null,
    "device": null,
    "user": {
    "id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
    "displayName": "Robin Kline",
    "userIdentityType": "aadUser"
    }
    },
    "body": {
    "contentType": "html",
    "content": "Hello World <at id="0">Jane Smith</at>"
    },
    "channelIdentity": {
    "teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
    "channelId": "19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2"
    },
    "attachments": [],
    "mentions": [
    {
    "id": 0,
    "mentionText": "Jane Smith",
    "mentioned": {
    "application": null,
    "device": null,
    "conversation": null,
    "user": {
    "id": "ef1c916a-3135-4417-ba27-8eb7bd084193",
    "displayName": "Jane Smith",
    "userIdentityType": "aadUser"
    }
    }
    }
    ],
    "reactions": []
    },
    {
    "id": "1616963377068",
    "replyToId": null,
    "etag": "1616963377068",
    "messageType": "message",
    "createdDateTime": "2021-03-28T20:29:37.068Z",
    "lastModifiedDateTime": "2021-03-28T20:29:37.068Z",
    "lastEditedDateTime": null,
    "deletedDateTime": null,
    "subject": "",
    "summary": null,
    "chatId": null,
    "importance": "normal",
    "locale": "en-us",
    "webUrl": "https://teams.microsoft.com/l/message/19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2/1616963377068?groupId=fbe2bf47-16c8-47cf-b4a5-4b9b187c508b&tenantId=2432b57b-0abd-43db-aa7b-16eadd115d34&createdTime=1616963377068&parentMessageId=1616963377068",
    "policyViolation": null,
    "eventDetail": null,
    "from": {
    "application": null,
    "device": null,
    "user": {
    "id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
    "displayName": "Robin Kline",
    "userIdentityType": "aadUser"
    }
    },
    "body": {
    "contentType": "html",
    "content": "<div><div><div><span><img height="145" src="https://graph.microsoft.com/v1.0/teams/fbe2bf47-16c8-47cf-b4a5-4b9b187c508b/channels/19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2/messages/1616963377068/hostedContents/aWQ9eF8wLXd1cy1kMS02YmI3Nzk3ZGU2MmRjODdjODA4YmQ1ZmI0OWM4NjI2ZCx0eXBlPTEsdXJsPWh0dHBzOi8vdXMtYXBpLmFzbS5za3lwZS5jb20vdjEvb2JqZWN0cy8wLXd1cy1kMS02YmI3Nzk3ZGU2MmRjODdjODA4YmQ1ZmI0OWM4NjI2ZC92aWV3cy9pbWdv/$value" width="131" style="vertical-align:bottom; width:131px; height:145px"></span><div> </div></div><div><div><span><img height="65" src="https://graph.microsoft.com/v1.0/teams/fbe2bf47-16c8-47cf-b4a5-4b9b187c508b/channels/19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2/messages/1616963377068/hostedContents/aWQ9eF8wLXd1cy1kNi0xMzY3OTE4MzVlODIxOGZlMmUwZWEwYTA1ODAxNjRiNCx0eXBlPTEsdXJsPWh0dHBzOi8vdXMtYXBpLmFzbS5za3lwZS5jb20vdjEvb2JqZWN0cy8wLXd1cy1kNi0xMzY3OTE4MzVlODIxOGZlMmUwZWEwYTA1ODAxNjRiNC92aWV3cy9pbWdv/$value" width="79" style="vertical-align:bottom; width:79px; height:65px"></span></div></div></div></div>"
    },
    "channelIdentity": {
    "teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
    "channelId": "19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2"
    },
    "attachments": [],
    "mentions": [],
    "reactions": []
    },
    {
    "id": "1616883610266",
    "replyToId": null,
    "etag": "1616883610266",
    "messageType": "unknownFutureValue",
    "createdDateTime": "2021-03-28T03:50:10.266Z",
    "lastModifiedDateTime": "2021-03-28T03:50:10.266Z",
    "lastEditedDateTime": null,
    "deletedDateTime": null,
    "subject": null,
    "summary": null,
    "chatId": null,
    "importance": "normal",
    "locale": "en-us",
    "webUrl": "https://teams.microsoft.com/l/message/19%3A4a95f7d8db4c4e7fae857bcebe0623e6%40thread.tacv2/1616883610266?groupId=fbe2bf47-16c8-47cf-b4a5-4b9b187c508b&tenantId=2432b57b-0abd-43db-aa7b-16eadd115d34&createdTime=1616883610266&parentMessageId=1616883610266",
    "policyViolation": null,
    "from": null,
    "body": {
    "contentType": "html",
    "content": "<systemEventMessage/>"
    },
    "channelIdentity": {
    "teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
    "channelId": "19:4a95f7d8db4c4e7fae857bcebe0623e6@thread.tacv2"
    },
    "attachments": [],
    "mentions": [],
    "reactions": [],
    "eventDetail": {
    "@odata.type": "#microsoft.graph.teamDescriptionUpdatedEventMessageDetail",
    "teamId": "fbe2bf47-16c8-47cf-b4a5-4b9b187c508b",
    "teamDescription": "Team for Microsoft Teams members",
    "initiator": {
    "application": null,
    "device": null,
    "user": {
    "id": "1fb8890f-423e-4154-8fbf-db6809bc8756",
    "displayName": null,
    "userIdentityType": "aadUser"
    }
    }
    }
    }
    ]
    }

    Ref Doc : https://learn.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-1.0&tabs=http

    1. There is no way to mention an outgoing webhook in the incoming webhook. Its not supported.

    Thanks,
    Nivedipa


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.


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.