taobao.user.seller.get
查询卖家用户信息
请求地址
| 环境 | HTTP地址 | HTTPS地址 | 请求方式 |
|---|---|---|---|
| 正式环境 | http://open.ieasynote.com/api | https://open.ieasynote.com/api | POST |
公共参数
| 参数名 | 类型 | 必须 | 描述 |
|---|---|---|---|
| method | String | 是 | API接口名称,例如:taobao.user.seller.get |
| app_key | String | 是 | TOP分配给应用的AppKey,例如:12345678 |
| session | String | 是 | 用户登录授权成功后,TOP颁发给应用的授权信息,详细介绍请[点击这里]()。当此API的标签上注明:“需要授权”,则此参数必传;“不需要授权”,则此参数不需要传;“可选授权”,则此参数为可选 |
| timestamp | String | 是 | 时间戳,格式为yyyy-MM-dd HH:mm:ss,时区为GMT+8,例如:2015-01-01 12:00:00。淘宝API服务端允许客户端请求最大时间误差为10分钟 |
| v | String | 是 | API协议版本,可选值:2.0 |
| sign_method | String | 是 | 签名的摘要算法,可选值为:hmac,md5,hmac-sha256 |
| sign | String | 是 | API输入参数签名结果,签名算法介绍请[点击这里]( |
| format | String | 否 | 响应格式。默认为xml格式,可选值:xml,json |
| simplify | Boolean | 否 | 是否采用精简JSON返回格式,仅当format=json时有效,默认值为:false |
公共响应参数
公共响应参数中,error_response 和 xxx_response只会出现一个
| 参数名 | 类型 | 描述 |
|---|---|---|
| request_id | String | 平台颁发的每次请求访问的唯一标识 |
| error_response | String | 请求访问失败时返回的根节点,和 xxxxx_response 只会出现一个 |
| code | String | 请求失败返回的错误码,error_response 的子节点 |
| msg | String | 请求失败返回的错误信息,error_response 的子节点 |
| sub_code | String | 请求失败返回的子错误码,error_response 的子节点 |
| sub_msg | String | 请求失败返回的子错误信息,error_response 的子节点 |
| xxxxx_response | String | 请求成功返回的根节点, 和 error_response 只会出现一个,'xxxxx' 为API名称的下划线模式,本接口为:user_seller_get_response |
请求参数
| 参数名 | 类型 | 必须 | 示例值 | 描述 |
|---|---|---|---|---|
| fields | String[] | 是 | nick,sex | 需要返回的字段列表,可选值为返回示例值中的可以看到的字段 |
请求响应参数
请求响应参数是 xxx_response 的子节点
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| user | User | 用户 | |
| -user_id | Number | 10001 | 用户数字ID |
| -nick | String | hz0799 | 用户昵称 |
| -sex | String | m | 性别。可选值:m(男),f(女) |
| -seller_credit | UserCredit | 卖家信用 | |
| -level | Number | 1 | 信用等级(是根据score生成的),信用等级:淘宝会员在淘宝网上的信用度,分为20个级别,级别如:level = 1 时,表示一心;level = 2 时,表示二心 |
| -score | Number | 1 | 信用总分(“好评”加一分,“中评”不加分,“差评”扣一分。分越高,等级越高) |
| -total_num | Number | 1 | 收到的评价总条数。取值范围:大于零的整数 |
| -good_num | Number | 1 | 收到的好评总条数。取值范围:大于零的整数 |
| type | String | B | 用户类型。可选值:B(B商家),C(C商家) |
| has_more_pic | Boolean | true | 是否购买多图服务。可选值:true(是),false(否) |
| item_img_num | Number | 5 | 可上传商品图片数量 |
| item_img_size | Number | 1024 | 单张商品图片最大容量(商品主图大小)。单位:k |
| prop_img_num | Number | 5 | 可上传属性图片数量 |
| prop_img_size | Number | 1024 | 单张销售属性图片最大容量(非主图的商品图片和商品属性图片)。单位:k |
| auto_repost | String | unlimited | 是否受限制。可选值:limited(受限制),unlimited(不受限) |
| promoted_type | String | authentication | 有无实名认证。可选值:authentication(实名认证),not authentication(没有认证) |
| status | String | normal | 状态。可选值:normal(正常),inactive(未激活),delete(删除),reeze(冻结),supervise(监管) |
| alipay_bind | String | bind | 有无绑定。可选值:bind(绑定),notbind(未绑定) |
| consumer_protection | Boolean | true | 是否参加消保 |
| vip_info | String | v1 | 用户的全站vip信息,可取值如下:c(普通会员),asso_vip(荣誉会员),vip1,vip2,vip3,vip4,vip5,vip6(六个等级的正式vip会员),共8种取值,其中asso_vip是由vip会员衰退而成,与主站上的vip0对应。 |
| magazine_subscribe | Boolean | true | 是否订阅了淘宝天下杂志 |
| vertical_market | String | 3C,shoes | 用户参与垂直市场类型。shoes表示鞋城垂直市场用户,3C表示3C垂直市场用户。多个类型之间用","分隔。如:一个用户既是3C用户又是鞋城用户,那么这个字段返回就是"3C,shoes"。如果用户不是垂直市场用户,此字段返回为""。 |
| avatar | String | https://url.png | 用户头像地址 |
| online_gaming | Boolean | true | 用户是否为网游用户,属于隐私信息,需要登陆才能查看自己的。 目前仅供taobao.user.get使用 |
| liangpin | Boolean | true | 是否是无名良品用户,true or false |
| sign_food_seller_promise | Boolean | true | 卖家是否签署食品卖家承诺协议 |
| has_shop | Boolean | true | 用户作为卖家是否开过店 |
| is_lightning_consignment | Boolean | true | 是否24小时闪电发货(实物类) |
| has_sub_stock | Boolean | true | 表示用户是否具备修改商品减库存逻辑的权限(一共有拍下减库存和付款减库存两种逻辑) 值含义: 1)true:是 2)false:否。 |
| is_golden_seller | Boolean | true | 用户是否是金牌卖家 |
| is_tjb_seller | Boolean | false | 是否是特价版商家,需要field查询 |
| displaynick | String | displayNIck001 | 用户展示昵称,不唯一,可被修改 |
| open_uid | String | adflajfaf | openuid |
请求示例代码
将接口地址URL设置成: http://open.ieasynote.com/api
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new UserSellerGetRequest;
$req->setFields("nick,sex");
$resp = $c->execute($req, $sessionKey);
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
UserSellerGetRequest req = new UserSellerGetRequest();
req.setFields("nick,sex");
UserSellerGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
UserSellerGetRequest req = new UserSellerGetRequest();
req.Fields = "nick,sex";
UserSellerGetResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
# -*- coding: utf-8 -*-
import top.api
req=top.api.UserSellerGetRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.fields="nick,sex"
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
curl -X POST 'http://open.ieasynote.com/api' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.user.seller.get' \
-d 'partner_id=apidoc' \
-d 'session=21a11837-2bb0-419c-bb2a-37eec825953d' \
-d 'sign=1F823C36BC202F60B4D52AC9AF1B1AB4' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-08-24+12%3A00%3A40' \
-d 'v=2.0' \
-d 'fields=nick%2Csex'
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://open.ieasynote.com/api'
});
client.execute('taobao.user.seller.get', {
'fields':'nick,sex'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})
package main;
import (
"fmt"
"topsdk"
"topsdk/defaultability"
"topsdk/defaultability/request"
)
func main() {
client := topsdk.NewDefaultTopClient("<your-appkey>","<your-appsecret>","<top-gateway-url>",20000,20000)
ability := defaultability.NewDefaultability(&client)
req := request.TaobaoUserSellerGetRequest{}
/*
nick,sex
*/
req.SetFields([]string{})
resp, err := ability.TaobaoUserSellerGet(&req, "<user-session>")
if(err != nil) {
fmt.Println(err)
} else {
fmt.Println(resp.Body)
}
}
<?php
require "../vendor/autoload.php";
use Topsdk\Topapi\TopApiClient;
use Topsdk\Topapi\Defaultability\Request\TaobaoUserSellerGetRequest;
use Topsdk\Topapi\Defaultability\Defaultability;
// create Client
$client = new TopApiClient("<your-appkey>","<your-appsecret>","<top-gateway-url>");
$ability = new Defaultability($client);
// create domain
// create request
$request = new TaobaoUserSellerGetRequest();
/*
nick,sex
*/
$request->setFields(array());
$response = $ability->taobaoUserSellerGet($request,"<user session>");
var_dump($response);
import com.alibaba.fastjson.JSON;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import com.taobao.top.TopApiClient;
import com.taobao.top.DefaultTopApiClient;
import com.taobao.top.TopFileItem;
import com.taobao.top.defaultability.Defaultability;
import com.taobao.top.defaultability.request.TaobaoUserSellerGetRequest;
import com.taobao.top.defaultability.response.TaobaoUserSellerGetResponse;
public class Main {
public static void main(String[] args) throws Exception {
// create Client
TopApiClient client = new DefaultTopApiClient("<your-appkey>","<your-appsecret>","<top-gateway-url>");
Defaultability apiPackage = new Defaultability(client);
// create domain
// create request
TaobaoUserSellerGetRequest request = new TaobaoUserSellerGetRequest();
/*
nick,sex
*/
request.setFields(new ArrayList<String>());
TaobaoUserSellerGetResponse response = apiPackage.taobaoUserSellerGet(request,"user session");
if(!response.isSuccess()){
System.out.println(response.getSubMsg());
}
System.out.println(JSON.toJSONString(response));
}
}
响应示例
<user_seller_get_response>
<user>
<user_id>10001</user_id>
<nick>hz0799</nick>
<sex>m</sex>
<seller_credit>
<level>1</level>
<score>1</score>
<total_num>1</total_num>
<good_num>1</good_num>
</seller_credit>
<type>B</type>
<has_more_pic>true</has_more_pic>
<item_img_num>5</item_img_num>
<item_img_size>1024</item_img_size>
<prop_img_num>5</prop_img_num>
<prop_img_size>1024</prop_img_size>
<auto_repost>unlimited</auto_repost>
<promoted_type>authentication</promoted_type>
<status>normal</status>
<alipay_bind>bind</alipay_bind>
<consumer_protection>true</consumer_protection>
<vip_info>v1</vip_info>
<magazine_subscribe>true</magazine_subscribe>
<vertical_market>3C,shoes</vertical_market>
<avatar>http://assets.taobaocdn.com/app/sns/img/default/avatar-120.png</avatar>
<online_gaming>true</online_gaming>
<liangpin>true</liangpin>
<sign_food_seller_promise>true</sign_food_seller_promise>
<has_shop>true</has_shop>
<is_lightning_consignment>true</is_lightning_consignment>
<has_sub_stock>true</has_sub_stock>
<is_golden_seller>true</is_golden_seller>
<is_tjb_seller>false</is_tjb_seller>
<displaynick>displayNIck001</displaynick>
<open_uid>adflajfaf</open_uid>
</user>
</user_seller_get_response>
{
"user_seller_get_response":{
"user":{
"user_id":10001,
"nick":"hz0799",
"sex":"m",
"seller_credit":{
"level":1,
"score":1,
"total_num":1,
"good_num":1
},
"type":"B",
"has_more_pic":true,
"item_img_num":5,
"item_img_size":1024,
"prop_img_num":5,
"prop_img_size":1024,
"auto_repost":"unlimited",
"promoted_type":"authentication",
"status":"normal",
"alipay_bind":"bind",
"consumer_protection":true,
"vip_info":"v1",
"magazine_subscribe":true,
"vertical_market":"3C,shoes",
"avatar":"http:\/\/assets.taobaocdn.com\/app\/sns\/img\/default\/avatar-120.png",
"online_gaming":true,
"liangpin":true,
"sign_food_seller_promise":true,
"has_shop":true,
"is_lightning_consignment":true,
"has_sub_stock":true,
"is_golden_seller":true,
"is_tjb_seller":false,
"displaynick":"displayNIck001",
"open_uid":"adflajfaf"
}
}
}
异常响应示例
<error_response>
<code>50</code>
<msg>Remote service error</msg>
<sub_code>isv.invalid-parameter</sub_code>
<sub_msg>参数异常</sub_msg>
</error_response>
{
"error_response":{
"msg":"Remote service error",
"code":50,
"sub_msg":"XXX",
"sub_code":"isv.invalid-parameter"
}
}
错误码描述
| 错误码 | 错误消息 | 解决方案 |
|---|---|---|
| isv.shop-not-exist:invalid-shop | 没有可访问的店铺 | 该接口是商家使用接口,非商家店铺不能查询、访问。 |