cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sifu
Continued Contributor
Continued Contributor

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
Super User

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
Super User

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,933)