Hey All,
Testing out Mattermost as a Slack Alternative. We’re using the self hosted opensource version (latest version) and are looking at automating some of the boards when a project is created, but I cant find anywhere any API documentation on this.
I have looked through here Mattermost API Reference and can see the general Mattermost stuff, and the playbooks at the bottom, but nothing on boards.
I know it was focalboard previously and has only just been integrated, but seems that the API endpoints here GitHub & BitBucket HTML Preview don’t seem to work with the mattermost endpoints as I’m getting 404 for everything I’ve tried thus far.
agriesser
(Alexander Griesser)
June 20, 2023, 2:26am
2
Hi James and welcome to the Mattermost forums!
Please check out this GitHub issue and let me know if it helped.
opened 06:26AM - 04 Jan 23 UTC
closed 11:23AM - 18 Jan 23 UTC
Bug
#### Summary
Unable to perform operations on the integrated focalboard via API.… Also, no mention of focalboard api in [mattermost docs](https://api.mattermost.com/).
#### Expected behavior
I installed a preview version of mattermost via docker container ([from these instructins](https://docs.mattermost.com/install/install-docker.html#preview-mattermost-using-docker). Ensured plugin is enabled and mattermost board is enabled. I want to perform operations on the mattermost board via API. For eg, writing a script to migrate our issues from another tool (say phabricator or gitlab issues) to focalboard. But I am unable to find any documentation around this. i tried the API endpoints mentioned in [focalboard docs](https://htmlpreview.github.io/?https://github.com/mattermost/focalboard/blob/main/server/swagger/docs/html/index.html#examples-Default-getBoards-0-python) but they are not working either.
Few queries that i tried
```
// query related to teams (from mattermost api)
$ curl -X GET -H "Authorization: Bearer wjd5jd9amby7bd59ye4cgo3egy" "http://127.0.0.1:8065/api/v4/teams"
[{"id":"6mnza3dgwiy7785ndk95ohbdsy","create_at":1672779224457,"update_at":1672779224457,"delete_at":0,"display_name":"sem","name":"sem","description":"","email":"trial@gmail.com","type":"O","company_name":"","allowed_domains":"","invite_id":"ukwofmfxn3yo389cngyrgouz9y","allow_open_invite":false,"scheme_id":null,"group_constrained":null,"policy_id":null,"cloud_limits_archived":false}]
// few queries related to boards
$ curl -X GET -H "Authorization: Bearer wjd5jd9amby7bd59ye4cgo3egy" "http://127.0.0.1:8065/teams/6mnza3dgwiy7785ndk95ohbdsy/boards"
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name="robots" content="noindex, nofollow"><meta name="referrer" content="no-referrer"><title>Mattermost</title><meta name="mobile-web-app-capable" content="yes"><meta name="application-name" content="Mattermost"><meta name="format-detection" content="telephone=no"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-16x16.png" sizes="16x16"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-24x24.png" sizes="24x24"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-64x64.png" sizes="64x64"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-96x96.png" sizes="96x96"><link rel="stylesheet" class="code_theme"><style>.error-screen{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding-top:50px;max-width:750px;font-size:14px;color:#333;margin:auto;display:none;line-height:1.5}.error-screen h2{font-size:30px;font-weight:400;line-height:1.2}.error-screen ul{padding-left:15px;line-height:1.7;margin-top:0;margin-bottom:10px}.error-screen hr{color:#ddd;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.error-screen-visible{display:block}</style><meta http-equiv="Content-Security-Policy" content="script-src 'self' cdn.rudderlabs.com/ js.stripe.com/v3"><script defer="defer" src="/static/main.94bef8661903342eb099.js"></script><meta name="apple-mobile-web-app-title" content="Mattermost" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="default" /><link rel="apple-touch-icon" sizes="76x76" href="/static/icon_76x76.png" /><link rel="apple-touch-icon" sizes="72x72" href="/static/icon_72x72.png" /><link rel="apple-touch-icon" sizes="60x60" href="/static/icon_60x60.png" /><link rel="apple-touch-icon" sizes="57x57" href="/static/icon_57x57.png" /><link rel="apple-touch-icon" sizes="152x152" href="/static/icon_152x152.png" /><link rel="apple-touch-icon" sizes="144x144" href="/static/icon_144x144.png" /><link rel="apple-touch-icon" sizes="120x120" href="/static/icon_120x120.png" /><link rel="manifest" href="/static/manifest.json" /></head><body class="font--open_sans enable-animations"><div id="root"><div class="error-screen"><h2>Cannot connect to Mattermost</h2><hr/><p>We're having trouble connecting to Mattermost. If refreshing this page (Ctrl+R or Command+R) does not work, please verify that your computer is connected to the internet.</p><br/></div><div class="loading-screen" style="position:relative"><div class="loading__content"><div class="round round-1"></div><div class="round round-2"></div><div class="round round-3"></div></div></div></div><div id="root-portal"></div><noscript>To use Mattermost, please enable JavaScript.</noscript></body></html>
$ curl -X GET -H "Authorization: Bearer wjd5jd9amby7bd59ye4cgo3egy" "http://127.0.0.1:8065/api/v2/teams/6mnza3dgwiy7785ndk95ohbdsy/boards"
{"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/teams/6mnza3dgwiy7785ndk95ohbdsy/boards'. Typo? are you missing a team_id or user_id as part of the url?","status_code":404}
$ curl -X GET -H "Authorization: Bearer wjd5jd9amby7bd59ye4cgo3egy" "http://127.0.0.1:8065/api/v4/teams/6mnza3dgwiy7785ndk95ohbdsy/boards"
{"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/v4/teams/6mnza3dgwiy7785ndk95ohbdsy/boards'. Typo? are you missing a team_id or user_id as part of the url?","status_code":404}bharath@tpx13:~/Documents/mnet_specific/SEM/sem-codebase/phab-migration/mattermost$
```
#### Observed behavior (that appears unintentional)
Pls advise with regards how to use API for boards.
NOTE: I had previously opened an issue at mattermost-server repo (https://github.com/mattermost/mattermost-server/issues/21981) but was asked to reopen it here