Giter Site home page Giter Site logo

topspin_api's Introduction

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 '[email protected]', '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.

topspin_api's People

Contributors

billhorsman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.