JavaScript DocBase API for Node.JS
This module provides an easy way to use DocBase API.
Installation
$ npm install docbase
More Info
set DOCBASE_API_TOKEN instead of DocBaseApi
's option.
$ export DOCBASE_API_TOKEN=xxxxxxxxxx
APIs
import module
import DocBaseApi from 'docbase';
const docbase = new DocBaseApi({
token: 'xxxxxxxxxxxxx'
});
所属チーム取得API
docbase.team.find().then(teams => {
const domain = teams[0].domain;
}).then(done, done);
メモの検索API
docbase.post.search(domain, {
q: 'test',
author: 'keita_moromizato',
tag: '日報',
group: '日報'
}).then(res => {
});
所属グループ取得API
docbase.group.find(domain).then(groups => {
});
タグの取得API
docbase.tag.find(domain).then(tags => {
});
メモの投稿API
const params = {
title: 'test title',
body: 'test body',
draft: false,
tags: ['test'],
scope: 'group',
groups: [1],
notice: false
};
docbase.post.create(domain, params).then(post => {
});
メモの詳細取得API
docbase.post.find(domain, 111).then(post => {
});
メモの更新API
TODO
メモの削除API
TODO
License
MIT
Test
$ export DOCBASE_API_TOKEN=xxxxxxxxxx
$ npm test
Reference
DocBase APIドキュメント