0.06
A long-lived project that still receives updates
Ruby client for api.aptible.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Development

~> 1.3
>= 0
~> 12.3.3
~> 3.9.0
~> 1.3.0

Runtime

 Project Readme

Aptible::Api

Gem Version Build Status Dependency Status

Ruby client for api.aptible.com. Aptible's API server is built on top of HAL+JSON, and so this client is just a thin layer on top of the HyperResource gem.

Installation

Add the following lines to your application's Gemfile.

gem 'aptible-api'

And then run bundle install.

Usage

First, get a token:

token = Aptible::Auth::Token.create(email: 'user0@example.com', password: 'password')

From here, you can interact with the API however you wish:

accounts = Aptible::Api::Account.all(token: token)
account = accounts.first
account.handle
# => 'aptible'
account.apps.first.handle
# => "foodle"
newapp = account.create_app(handle: 'bardle')
newapp.href
# => "http://localhost:4001/apps/7"

Configuration

Parameter Description Default
root_url Root URL of the API server ENV['APTIBLE_API_ROOT_URL'] or https://api.aptible.com

To point the client at a different API server (e.g., during development), add the following to your application's initializers (or set the APTIBLE_API_ROOT_URL environment variable):

Aptible::Api.configure do |config|
  config.root_url = 'http://some.other.url'
end

Contributing

  1. Fork the project.
  2. Commit your changes, with specs.
  3. Ensure that your code passes specs (rake spec) and meets Aptible's Ruby style guide (rake rubocop).
  4. Create a new pull request on GitHub.

Copyright and License

MIT License, see LICENSE for details.

Copyright (c) 2019 Aptible and contributors.