Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Client for TopSpin API
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
CHANGELOG.md
Gemfile
README.md
Rakefile
topspin_api.gemspec

README.md

A Client for the TopSpin API

Topspin is an ecommerce platform for musicians. It provides an API that this gem uses. This gem doesn't do anything spectacular, it just makes it easy to connect your Ruby app to the API.

It was developed by Bandzoogle, the band website platform. Bandzoogle integrates nicely with Topspin.

Installation

If you're using bundler:

source "http://rubygems.org"
gem 'topspin_store'

Usage

> store = TopspinApi::Store.new 1234
 => #<TopspinApi::Store:0x007fbc3a052b40...
> store.authenticate 'me@example.com', 'MYAPIKEY123456'

In the above example, 1234 refers to your artist_id.

TopspinApi::Store#offers

Gets a list of offers available from the store:

> offers = store.offers
 => [{"id"=>59484, "price"=>"$100.00", "currency"=>"USD", ...

The array is paginated by the API - you can fetch other pages using the :page option

> offers = store.offers :page => 2

The array has been extended to include information about the pagination. For instance, if there were 30 offers:

> offers.total_pages
 => 2
> offers.current_page
 => 1
> offers.total_entries
 => 30
> offers.per_page
 => 25

TopspinApi::Store#detail

Gets detailed information about one offer:

> store.detail(59484)
 => {"id"=>59484, "price"=>"$100.00", "currency"=>"USD", ...

Errors

These are the errors you might expect:

  • TopspinApi::ClientError - either your credentials are wrong or you've asked for a resource that doesn't exist.
  • TopspinApi::InternalError - an unexpected problem with the API.
  • Timeout::Error - the API has taken longer than 3 seconds to respond.

Topspin API

See the API for more information.

Something went wrong with that request. Please try again.