Using Microsoft Teams through HTTP request

Description

I was trying to use Microsoft Teams node to post message in a specific channel (which can be done and work perfectly) and then be able to comment a particular message (which is not currently possible) :
image

Then I tried to look at this documentation Send replies to a message in a channel - Microsoft Graph v1.0 | Microsoft Docs to use Microsoft graph API directly. But it is mentionned that the Auth in the header request need a “Bearer token”.

I found this documentation Get access without a user - Microsoft Graph | Microsoft Docs, that explain how to create an app in Microsoft Azure, and through multiple http requests get a “Bearer Token” at the end.

I tried to follow the documation and make the HTTP request through the n8n node, but it never worked…

I put everything as in the documentation (client ID, client secret, tenant ID, scope…) in the OAuth2 header but it doesn’t work, and I get this error message :


Which is not very relevant…

I was wondering if you had any idea maybe.
Thanks in advance.

Information on my n8n setup

  • n8n version: 0.153.0
  • Database you’re using (default: SQLite): default
  • Running n8n with the execution process [own(default), main]: default
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: I was doing testing in Desktop app, but it should be on our own server later…

Hi @Polz, welcome to the community :tada:

I am sorry to hear you’re having trouble here. The error message is indeed not particularly relevant so I won’t be able to confirm the exact cause of the problem. Could you share the problematic node with me (you can, of course, redact any confidential values)? You can simply select the node on the n8n canvas and press Ctrl+C to get the underlying JSON code.

I haven’t used these MS APIs yet, so it’ll probably take me a while to get the hang, but am happy to look into this.

Thanks !
I can share with you the node, but I don’t know, it’s just a basic HTTP request with a OAuth2 authentification :

(I have only removed the tenant ID from the URL)

I have just followed the 2nd documentation I’ve mentionned for the auth…

Hi @Polz, apologies for my late reply here. Any chance you can upgrade your n8n version and retry this request? With version 0.156.0 we now show the error body of failed requests and I suspect this might be helpful here. The latest desktop version available on our website uses version 0.160.0 so would include this improvement.