Overview
The plugin enable easy integration with the [Taobao Open Platform]: open.taobao.com/doc/api_list.htm?id=102
Installation and configuration
Create a config/taobao.yml
default: &default
api_key: 12012322
secret_key: sandbox2a5bea25d1bc06ccd23123121daf
auth_url: https://oauth.tbsandbox.com/authorize
token_url: https://oauth.tbsandbox.com/token
rest_url: http://gw.api.tbsandbox.com/router/rest
callback_url: http://0.0.0.0:3000/auth/callback
development:
<<: *default
test:
<<: *default
production:
<<: *default
secret_key: 42ab2d12a5bea25d1bc06ccd23123121daf
auth_url: https://oauth.taobao.com/authorize
token_url: https://oauth.taobao.com/token
rest_url: http://gw.api.taobao.com/router/rest
callback_url: http://yourdomain.com/auth/callback
Usage
Topsdk.
# => "https://oauth.tbsandbox.com/authorize?response_type=code&client_id=12012322&redirect_uri=http://0.0.0.0:3000/auth/callback"
session = Topsdk.token('lv5W8xgdDc6pf8DzEWIe2Zgt2928')
params = {
:session => session,
:method =>'taobao.user.get',
:fields => 'uid,nick,email',
}
Topsdk.get_with(params)
# => {"user"=>{"email"=>"[email protected]", "nick"=>"nill", "uid"=>"00000000000"}}