Minato Ruby Api Client
The Minato ruby HTTP Client.
Installation
Install via command gem
gem install minato_ruby_api_client
Install via Gemfile
gem 'minato_ruby_api_client'
Install from Git
gem 'minato_ruby_api_client', git: 'https://gitlab.com/ferreri/minato/minato-ruby-api-client.git', ref: 'v0.2.3', glob: '*.gemspec'
Getting Started
Please follow the installation procedure and then run the following code:
# Load the gem
require 'minato_ruby_api_client'
# Setup authorization via config
MinatoRubyApiClient.configure do |config|
# Configure API key
config.api_key['Your-Subscription-Key'] = 'YOUR API KEY'
# Configure base path
config.base_path = 'YOUR BASE PATH'
end
client = MinatoRubyApiClient::ApiClient.default
# All available options
opts = {
header_params: { 'Source' => 'Your Source' },
query_params: {}, # When does not have value you can ommit the option
form_params: {},
body: { email: 'test@email' },
auth_names: 'apikey',
return_type: 'Object' # To return a generic hash you must use 'Object', for other types see examples.
}
# dispatch request
data, status, headers = client.api_call(:post, '/v1/accounts', opts)
# data => 'Response body'
# status => 'Response status'
# headers => 'Response headers'