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-oauth2-api
Or if you are using bundler, add
gem 'linkshare-oauth2-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 = "#############################################" Linkshare.custom_report_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') ... # Custom Reports API report = Linkshare.customreports.fetchReports('custom-report-name', '2016-01-27', '2016-01-27', 5) ... # 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")