DocBase API Client, written in Ruby.
Add this line to your application's Gemfile:
gem 'docbase'
And then execute:
$ bundle
Or install it yourself as:
$ gem install docbase
client = DocBase::Client.new(access_token: 'your_access_token', team: 'your_team')
or
ENV['DOCBASE_ACCESS_TOKEN'] = 'your_access_token'
client = DocBase::Client.new(team: 'your_team')
client.teams.body
# => [{ domain: 'kray', name: 'kray' }, { domain: 'danny', name: 'danny' }]
client.tags.body
# => [{ name: 'ruby' }, { name: 'rails' }]
client.groups.body
# => [{ id: 1, name: 'DocBase' }, { id: 2, name: 'kray' }]
params = {
title: 'memo title',
body: 'memo body',
draft: false,
tags: ['rails', 'ruby'],
scope: 'group',
groups: [1],
notice: true,
}
client.posts(params).body
# => {
# id: 1,
# title: 'memo title',
# body: 'memo body',
# draft: false,
# url: 'https://kray.docbase.io/posts/1',
# created_at: '2015-03-10T12:01:54+09:00',
# tags: [
# { name: 'rails' },
# { name: 'ruby' },
# ],
# scope: 'group',
# groups: [
# { name: 'DocBase' }
# ],
# user: {
# id: 1,
# name: 'danny'
# },
# }
client = DocBase::Client.new(access_token: 'your_access_token', team: 'kray')
client.tags.body
# => [{ name: 'ruby' }, { name: 'rails' }]
client.team = 'danny'
client.tags.body
# => [{ name: 'javascript' }, { name: 'react' }]
https://help.docbase.io/posts/45703
The gem is available as open source under the terms of the MIT License.