cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MattTaylor
Level: Powered On

Sending a Teams channel message using the Graph API

Hi folks,

 

Apologies if this is a bit of basic question but I'm having an issue trying to send a message on a channel using the Graph API. 

 

I get an authorisation error and I am guessing it's because I'm trying to use an Application rather than a user to do it. This is from the Graph API documentation: 

 

teamsquestion.png

Am I right in thinking that trying to make an HTTP POST from within a Flow (authenticated with an access token) won't work because of the permissions?

 

For reference I'm using an application registered in Azure AD with Group.ReadWrite.All permissions and I'm using the HTTP connector in Flow to first get an access token and then to send a POST request to the Graph API to try and message the Team channel. 

The reason I'm not using the built-in Teams connectors is that I need to send a message to a Team channel that's not in the same tenant as the Flow (development tenant). 

 

Kind regards,

 

Matt

 

1 REPLY 1
Community Support Team
Community Support Team

Re: Sending a Teams channel message using the Graph API

Hi @MattTaylor ,

 

I am afraid that it is caused by the permission issue.

 

As the Permissions you’ve provided, Application is not supported in the Graph API.

 

Instead of using the Graph API, please consider create a Custom API then register it with flow.

 

Please refer to the following docs on Custom connectors in Microsoft Flow:

https://docs.microsoft.com/en-us/flow/developer/register-custom-api

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 173 members 5,010 guests
Recent signins:
Please welcome our newest community members: