Ruby wrapper for the Nulab's Backlog API.
http://developer.nulab-inc.com/docs/backlog
Add this line to your application's Gemfile:
gem 'backlog_kit'
And then execute:
$ bundle
Or install it yourself as:
$ gem install backlog_kit
require 'backlog_kit'
client = BacklogKit::Client.new(
space_id: 'emsk',
api_key: '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234'
)
client.get_space.body # get body
client.get_space.headers # get headers
client.get_space.status # get status
client.get_space_activities # no params
client.get_space_activities(activity_type_id: [1, 4], min_id: 100) # underscored key
client.get_space_activities(activityTypeId: [1, 4], minId: 100) # camelized key
client.get_groups.body[0].members[0].mail_address # method chaining
You can also use low-level methods.
client.get('projects/1234/customFields') # GET
client.post('groups', name: 'beer') # POST
client.put('space/notification', content: 'Cheers!') # PUT
client.patch('groups/3712', name: 'whiskey') # PATCH
client.delete('groups/3712') # DELETE
client = BacklogKit::Client.new(
space_id: 'emsk',
api_key: '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234'
)
client = BacklogKit::Client.new(
space_id: 'emsk',
api_key: nil, # api_key should be nil
access_token: 'abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcd'
)
ENV Variable | Description |
---|---|
BACKLOG_SPACE_ID |
Your Backlog SPACE ID. |
BACKLOG_TOP_LEVEL_DOMAIN |
Your Backlog TOP LEVEL DOMAIN. |
BACKLOG_API_KEY |
Your Backlog API KEY. |
BACKLOG_OAUTH_CLIENT_ID |
CLIENT ID of your Backlog application. |
BACKLOG_OAUTH_CLIENT_SECRET |
CLIENT SECRET of your Backlog application. |
BACKLOG_OAUTH_REFRESH_TOKEN |
REFRESH TOKEN obtained from the Backlog token endpoint. |
You can create instance more easily.
client = BacklogKit::Client.new
BacklogKit supports Backlog API 2.9.0.
BacklogKit's API documentation is here.
- Ruby 2.0.0
- Ruby 2.1
- Ruby 2.2
- Ruby 2.3
- Ruby 2.4
- Ruby 2.5
See backlog_kit.gemspec
.
- Fork it ( https://github.com/emsk/backlog_kit/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request