How to connect/authenticate the Mattermost API with n8n?

I’m relatively new to using the HTTP module in N8n, hope I’ve got most things right.

First I went into my self hosted Mattermost to enable API access, so that in my settings I can create a personal API key.

Then I go into N8n to create a HTTP Module.

I’ve decided to start with getting all the cards from a board.
https://htmlpreview.github.io/?https://github.com/mattermost/focalboard/blob/main/server/swagger/docs/html/index.html#api-Default-getCards

So I search for the board ID by going to my website and select the string from the url like this:
https://website.com/boards/team/**ib19zocauida40cgqrfhkq7doo**/btn79n8nd88eimb5348a4co15er/vjcbzjwsm37n4deehwzatazxshc

I set Method to GET and URL to:
https://website.com/api/v2/boards/ib19zocauida38cgqrfhkq7doo/cards
(website.com is used as a placeholder for my own domain)

Then I set Authentication to Generic Credential Type with Header Auth.

In the Header Auth I set
Name: Authorization
Value: {{personal api key}}

But then I get this kind of error in which I don’t know if it’s authentication that goes wrong or something else:

{“status”:“rejected”,“reason”:{“message”:“404 - "{\"id\":\"api.context.404.app_error\",\"message\":\"Sorry, we could not find the page.\",\"detailed_error\":\"There doesn’t appear to be an api call for the url=‘/api/v2/boards/ib19zocauida33cgqrfhkq7doo/cards’. Typo? are you missing a team_id or user_id as part of the url?\",\"status_code\":404}"”,“name”:“Error”,“stack”:“Error: 404 - "{\"id\":\"api.context.404.app_error\",\"message\":\"Sorry, we could not find the page.\",\"detailed_error\":\"There doesn’t appear to be an api call for the url=‘/api/v2/boards/ib19zocauida33cgqrfhkq7doo/cards’. Typo? are you missing a team_id or user_id as part of the url?\",\"status_code\":404}"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”}}

Hi @creators ,

the path is a bit different, the documentation unfortuantely only refers to focalboard as a standalone product (it’s being integrated into the product at the moment, so things like that are still in the works).
When boards are running as a plugin, the URL to access the API needs to be the plugin API URL, which is https://website.com/plugions/focalboard/api/v2/ - can you try that?

Please note that you will also need a CSRF token, check out the latest comment in this GitHub issue:

Hi @agriesser ,

Ah yes that path gives back data, allthough it’s the same empty data as mentioned in that github card. So I’m getting closer :grin:
Would I then just copy paste that set of headers code as “Using JSON” or “Fields” (fields with Name and Value)?
This is something I find a bit hard, but maybe that’s just on me needing to learn n8n better :see_no_evil:

Thanks anyway, appreciate your help!