cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sifu
Responsive Resident
Responsive Resident

Post a reply to teams via "Invoke an HTTP request"

Hi all, 

i am aware that power automate is offering functions to filter messages based on some criteria (I use the subject most often) but its not possible to mention the channel... On the other side, we can post a new message to the channel via HTTP Request as stated here.

Now I need to figure out how to post a reply to an existing message, while mentioning the channel...

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

Hi @Sifu,

 

Yes, this should be possible via the replies method:

https://docs.microsoft.com/en-us/graph/api/channel-post-messagereply?view=graph-rest-1.0&tabs=http

 

Compared to me previous example you should be using a different Url in the HTTP request. This Url also contains a message id and the /replies method.

In the example below I am using a Message variable for that btw.

 

Url for HTTP request

https://graph.microsoft.com/beta/teams/@{variables('Team')}/channels/@{variables('Channel')}/messages/@{variables('Message')}/replies

 

Body

{
    "body": {
    "content": "This is a reply with a channel mention, <at id=\"0\">Channel mentioning</at>",
    "contentType": "html"
            },
    "mentions": [
                {
                "id": 0,
                "mentionText": "Channel mentioning",
                "mentioned": {
                                "conversation": {
                                                    "id": "@{variables('Channel')}",
                                                    "displayName": "Channel mentioning",
                                                    "conversationIdentityType@odata.type": "#Microsoft.Teams.GraphSvc.conversationIdentityType",
                                                    "conversationIdentityType": "channel"
                                                }
                            }
                }
                ]
}

 

replywithchannelmention.png

View solution in original post

1 REPLY 1
Expiscornovus
Super User II
Super User II

Hi @Sifu,

 

Yes, this should be possible via the replies method:

https://docs.microsoft.com/en-us/graph/api/channel-post-messagereply?view=graph-rest-1.0&tabs=http

 

Compared to me previous example you should be using a different Url in the HTTP request. This Url also contains a message id and the /replies method.

In the example below I am using a Message variable for that btw.

 

Url for HTTP request

https://graph.microsoft.com/beta/teams/@{variables('Team')}/channels/@{variables('Channel')}/messages/@{variables('Message')}/replies

 

Body

{
    "body": {
    "content": "This is a reply with a channel mention, <at id=\"0\">Channel mentioning</at>",
    "contentType": "html"
            },
    "mentions": [
                {
                "id": 0,
                "mentionText": "Channel mentioning",
                "mentioned": {
                                "conversation": {
                                                    "id": "@{variables('Channel')}",
                                                    "displayName": "Channel mentioning",
                                                    "conversationIdentityType@odata.type": "#Microsoft.Teams.GraphSvc.conversationIdentityType",
                                                    "conversationIdentityType": "channel"
                                                }
                            }
                }
                ]
}

 

replywithchannelmention.png

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (10,722)