class Bondora::API

Public Class Methods

new(auth_code, *sandbox) click to toggle source

Create new API client

@param auth_code [String] authorization code @param sandbox [Bool] mode switch @return [Object] Bondora::API object

# File lib/bondora/api.rb, line 10
def initialize(auth_code, *sandbox)
  self.class.headers 'Authorization' => "Bearer #{auth_code}"

  if sandbox
    self.class.base_uri 'https://api-sandbox.bondora.com/api/v1'
  else
    self.class.base_uri 'https://api.bondora.com/api/v1'
  end
end

Public Instance Methods

auction(auction_id) click to toggle source

Get auction for specified auction

@param auction_id [String] auction id @return [String] specified auction as JSON string.

# File lib/bondora/api.rb, line 32
def auction(auction_id)
  self.class.get("/auction/#{auction_id}").to_json
end
auctions() click to toggle source

Get all auctions

@return [String] all auctions as JSON string.

# File lib/bondora/api.rb, line 24
def auctions
  self.class.get('/auctions').to_json
end
balance() click to toggle source

Get account balance details

@return [String] account balance details as JSON string.

# File lib/bondora/api.rb, line 62
def balance
  self.class.get('/account/balance').to_json
end
bid(bid_id) click to toggle source

Get bid details

@param bid_id [String] bid id @return [String] bid details as JSON string.

# File lib/bondora/api.rb, line 102
def bid(bid_id)
  self.class.get("/bid/#{bid_id}").to_json
end
bids() click to toggle source

Get bids

@return [String] bids as JSON string.

# File lib/bondora/api.rb, line 94
def bids
  self.class.get('/bids').to_json
end
investments() click to toggle source

Get account investments

@return [String] investments as JSON string.

# File lib/bondora/api.rb, line 69
def investments
  self.class.get('/account/investments').to_json
end
loandataset() click to toggle source

Get loandatasets

@return [String] loandatasets as JSON string.

# File lib/bondora/api.rb, line 109
def loandataset
  self.class.get('/loandataset').to_json
end
loanpart(loanpart_id) click to toggle source

Get loanpart details

@param loanpart_id [String] loanpart id @return [String] loanpart details as JSON string.

# File lib/bondora/api.rb, line 55
def loanpart(loanpart_id)
  self.class.get("/loanpart/#{loanpart_id}").to_json
end
report(report_id) click to toggle source

Get report details

@param report_id [String] report id @return [String] report details as JSON string.

# File lib/bondora/api.rb, line 124
def report(report_id)
  self.class.get("/report/#{report_id}").to_json
end
reports() click to toggle source

Get reports

@return [String] reports as JSON string.

# File lib/bondora/api.rb, line 116
def reports
  self.class.get('/reports').to_json
end
secondarymarket() click to toggle source

Get all secondary market offers

@return [String] all secondary market offers as JSON string.

# File lib/bondora/api.rb, line 39
def secondarymarket
  self.class.get('/secondarymarket').to_json
end
secondarymarket_item(item_id) click to toggle source

Get secondary market item details

@param item_id [String] secondary market item id @return [String] secondary market item details as JSON string.

# File lib/bondora/api.rb, line 47
def secondarymarket_item(item_id)
  self.class.get("/secondarymarket/#{item_id}").to_json
end