获取单个用户信息
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
user | User | 用户 | |
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); UserGetRequest req = new UserGetRequest(); req.setFields("nick,type,sex,location"); req.setNick("helloworld"); req.setTopMixParams("nick"); UserGetResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody());
<user_get_response> <user> <user_id>10001</user_id> <uid>1001</uid> <nick>hz0799</nick> <sex>m</sex> <buyer_credit> <level>1</level> <score>1</score> <total_num>1</total_num> <good_num>1</good_num> </buyer_credit> <seller_credit> <level>1</level> <score>1</score> <total_num>1</total_num> <good_num>1</good_num> </seller_credit> <location> <zip>310000</zip> <city>杭州</city> <state>浙江</state> <country>中国</country> <district>西湖区</district> </location> <created>2000-01-01 00:00:00</created> <last_visit>2000-01-01 00:00:00</last_visit> <birthday>2000-01-01 00:00:00</birthday> <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> <sign_consumer_protection>true</sign_consumer_protection> <vip_info>v1</vip_info> <alipay_account>hz0799@163.com</alipay_account> <alipay_no>10001</alipay_no> <magazine_subscribe>true</magazine_subscribe> <vertical_market>3C,shoes</vertical_market> <email>xiaoming@taobao.com</email> <manage_book>true</manage_book> <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> <vip_level>0</vip_level> <open_uid>AAHULelzAF5F4XkqJWwAhq84</open_uid> </user> </user_get_response>
<error_response> <code>50</code> <msg>Remote service error</msg> <sub_code>isv.invalid-parameter</sub_code> <sub_msg>非法参数</sub_msg> </error_response>
错误码 | 错误描述 | 解决方案 |
---|---|---|
isv.user-not-exist:invalid-nick | 传入的nick不存在 | 发生错误不要重试,清除本地数据库该用户资料,或者使用其他接口(如:taobao.item.get)来更新用户资料 |
isv.missing-parameter:nick-or-session | 用户没有传入系统参数session也没有传入nick | 传入nick或者session |
错误码:40,子错误码:null | 缺少必要的传入参数 | |
isv.user-not-exist:invalid-nick:UIC service flow controlled | 12 | 2 |