GithubHelp home page GithubHelp logo

elastic-infra / backlog_kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emsk/backlog_kit

1.0 0.0 0.0 296 KB

Client library for the Nulab's Backlog API version 2 written in Ruby.

License: MIT License

Shell 0.02% Ruby 99.98%

backlog_kit's Introduction

BacklogKit

Build Status Codecov Code Climate License

Ruby wrapper for the Nulab's Backlog API.

https://developer.nulab.com/docs/backlog/

Installation

Add this line to your application's Gemfile:

gem 'backlog_kit'

And then execute:

$ bundle

Or install it yourself as:

$ gem install backlog_kit

Usage

require 'backlog_kit'

client = BacklogKit::Client.new(
  space_id: 'elastic-infra',
  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

Authentication

API key

client = BacklogKit::Client.new(
  space_id: 'elastic-infra',
  api_key: '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234'
)

OAuth access token

client = BacklogKit::Client.new(
  space_id: 'elastic-infra',
  api_key: nil, # api_key should be nil
  access_token: 'abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcd'
)

BacklogKit::Client Config

Variable ENV Variable Description Default
space_id BACKLOG_SPACE_ID Your Backlog SPACE ID.
second_level_domain BACKLOG_SECOND_LEVEL_DOMAIN Your Backlog SECOND LEVEL DOMAIN. backlog
top_level_domain BACKLOG_TOP_LEVEL_DOMAIN Your Backlog TOP LEVEL DOMAIN. com
api_key BACKLOG_API_KEY Your Backlog API KEY.
client_id BACKLOG_OAUTH_CLIENT_ID CLIENT ID of your Backlog application.
client_secret BACKLOG_OAUTH_CLIENT_SECRET CLIENT SECRET of your Backlog application.
refresh_token BACKLOG_OAUTH_REFRESH_TOKEN REFRESH TOKEN obtained from the token endpoint.

If you set ENV variables, you can create an instance more simply.

client = BacklogKit::Client.new

Supported Backlog API Version

BacklogKit supports Backlog API 2.32.2.

BacklogKit's API documentation is here.

Supported Ruby Versions

  • Ruby 2.7
  • Ruby 3.0
  • Ruby 3.1
  • Ruby 3.2
  • Ruby 3.3

Contributing

  1. Fork it ( https://github.com/elastic-infra/backlog_kit/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

MIT

backlog_kit's People

Contributors

emsk avatar hkobayash avatar tamano avatar interu avatar sakihet avatar

Stargazers

Kyohei Watanabe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.