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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (2,579)