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.
If you're using bundler:
source "http://rubygems.org"
gem 'topspin_store'
> store = TopspinApi::Store.new 1234
=> #<TopspinApi::Store:0x007fbc3a052b40...
> store.authenticate '[email protected]', 'MYAPIKEY123456'
In the above example, 1234
refers to your artist_id.
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
Gets detailed information about one offer:
> store.detail(59484)
=> {"id"=>59484, "price"=>"$100.00", "currency"=>"USD", ...
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.
See the API for more information.