RmsWebService
RMS Webservice APIのRubyラッパーです。
ご注意
- 楽天市場出店者のみが利用できるAPIです。
- 現在一部機能のみサポートしています。
- 非公式です。
Installation
Add this line to your application's Gemfile:
gem 'rms_web_service'And then execute:
$ bundle
Or install it yourself as:
$ gem install rms_web_service
Usage
現在、itemAPIのみサポートしています。パラメータについては公式ドキュメントを参照してください。
サービスIDとライセンスキーを設定したクライアントインスタンスを生成します。各キーはRMSより発行できます。
client = RmsWebService::Client::Item.new(service_secret: "dummy_service_secret", license_key: "dummy_license_key")RmsWebService::Client::Item
RmsWebService::Client::ItemのインスタンスがAPIの各メソッドを持っています。各メソッドへのパラメータの渡し方は下記の通りです。
item = client.get("ed-60c-w")
# '.item_name'、'.item_price'等のメソッドを持ちます。属性については公式ドキュメントを見てください。
item = client.delete("test001")
# '.success?'で成功したかどうかを判別できます。'.errors'でエラー内容を確認できます。
item = client.update({:item_url => "ed-60c-w", :item_price => 43800})
# '.success?'で成功したかどうかを判別できます。'.errors'でエラー内容を確認できます。
item = client.insert({
  :item_url => "test001",
  :item_name => "test001",
  :item_price => "100000",
  :genre_id => "211889",
})
# '.success?'で成功したかどうかを判別できます。'.errors'でエラー内容を確認できます。
items = client.search(:item_name => "空気清浄機")
# item.getと同じ性質のインスタンスを要素として持つ配列を返します
items = client.items_update([
  {:item_url => "ed-60c-w", :item_price => 43800},
  {:item_url => "noexist", :item_price => 10800}
])
# item.updateと同じ性質のインスタンスを要素として持つ配列を返しますContributing
- Fork it ( https://github.com/[my-github-username]/rms_web_service/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request