Linkshare

A Ruby implementation of the Rakutan Linkshare API’s. This gem provides access to the following APIs:

## Before You Begin

You will require an account with Linkshare, subscriptions to the API’s and OAuth2 credentials which can be obtained by followng the instructions in the Aquiring your Access Token document

You will need the following peices of information:

  • AccountID (SID or MID)

  • Account Username

  • Account Password

  • Consumer Key

  • Consumer Secret

  • Security Token

## Installation

To install linkshare, run the following command:

gem install linkshare-ouath2-api

Or if you are using bundler, add

gem 'linkshare-ouath2-api'

to your ‘Gemfile`, and run `bundle install`

Then add the following code to an initializer:

require 'linkshare'
Linkshare.consumer_key = "#########################"
Linkshare.consumer_secret = "#########################"
Linkshare.sid = "1234567"
Linkshare.username = "username"
Linkshare.password = "password"
Linkshare.security_token = "#############################################"

## Usage Examples

require 'linkshare'

# Coupons API
coupn = Linkshare.coupon
coupn.fetch
coupn.getCoupons

...

# Link Locator API
merchants = Linkshare.linklocator.getMerchByAppStatus(:approved) 

...

# Advanced Reports API
report = Linkshare.advancedreports.fetchReports(6, '20150101', '20160101')

...

# Product Search API
products = Linkshare.productsearch
products.addKeyword('Toy','keyword')
products.getProducts

...

# Events API
events = Linkshare.events.getEvents

...

# Advertiser Search API
advertiser = Linkshare.advertisersearch.getAdvertisers ("Example Store")