LoginSignup
5
6

More than 5 years have passed since last update.

WekanのREST APIを使ってみる

Last updated at Posted at 2017-07-10

Wekanについて

オープンソースのかんばんツールの1つです。
かんばんツールはいろいろありますが、
シンプルな機能なところがとても気に入っています。

シンプルすぎてちょっと困ることも...

操作性とか気軽にカードを作れるところはすごく良いのですが
ユーザ管理や検索機能といったものがありません。
(そのうち追加されるかもしれませんが)

特に検索機能がないのは、使ってるメンバーには不便みたいです

REST APIで作っちゃおう

V0.19以降からwekanにはREST APIが追加されていますので
これをうまく使えば、検索機能を作ることができます。

v0.27時点では、以下のAPIが実装されているようです
- /api/user
- /api/users/:userid/boards
- /api/boards
- /api/boards/:boardid/lists
- /api/boards/:boardid/lists/:listid/cards
- /api/boards/:boardid/lists/:listid/cards/:cardid

※他にもあるようですが、割愛します...

ちょっとハマったのが、認証についてです。

良く良く読むと
https://github.com/wekan/wekan/pull/1033

このページに
「Just add your token to your reauest header like Authorization: Bearer tokenid」
と書いてありますので、headerにAuthorization:Bearer (tokenid)を付けることで
うまく行きました

ちなみにtokenidの取り方も同じページに書いてありまして
POST /user/loginで取得できます。

{
  "username": "ユーザ名",
  "password": "パスワード"
}

同じことで困っている方がいましたら
ぜひ使ってみてください!

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6