[编辑] 描述
- 得到用户信息,当对方设置了隐私权限,只能返回用户的姓名(name)、性别(sex)、是否为星级用户(star)、头像(headurl)等数据。。去测试控制台测试此接口。
[编辑] 参数表
-
-
| Required |
Name |
Type |
Description |
| required |
api_key |
string |
登记应用时分配到的api_key. |
|
method |
string |
users.getInfo |
|
call_id |
float |
请求队列号 |
|
sig |
string |
用于验证的数字签名,后续会给出具体的策略 |
|
v |
string |
API的版本号,请设置成 1.0. |
|
uids |
string |
需要查询的用户的id。 |
| optional |
format |
string |
Response的格式。请指定为XML(缺省值) |
|
fields |
string |
返回的字段列表,可以指定返回那些字段,用逗号分隔。如:name,sex,hometown_location。如果不传递此参数默认返回uid,name,tinyurl,headhurl,zidou,star |
|
session_key |
string |
登录用户的session key. 用于验证是否为当前用户发出的请求,如果出现Session Key过期的情况请参考关于session_key过期,如果不传递此参数默认指定用户的uid,name,tinyurl,headhurl,zidou,star |
[编辑] 返回XML样例
<?xml version="1.0" encoding="UTF-8"?>
<users_getInfo_response xmlns="http://api.xiaonei.com/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.xiaonei.com/1.0/
http://api.xiaonei.com/1.0/xiaonei.xsd" list="true">
<user>
<uid>8055</uid>
<name>刘德华</name>
<sex>1</sex>
<star>1</star>
<zidou>1</zidou>
<birthday>1961-09-27</birthday>
<email_hash>650628530_9c6b2b93842c46155b75b14a34054924</email_hash>
<tinyurl>
http://head.xiaonei.com/photos/tiny_10942g177.jpg
</tinyurl>
<headurl>
http://head.xiaonei.com/photos/tiny_10942g177.jpg
</headurl>
<mainurl>
http://head.xiaonei.com/photos/tiny_10942g177.jpg
</mainurl>
<hometown_location>
<country>中国</country>
<province>黑龙江</province>
<city>哈尔滨</city>
</hometown_location>
<work_history list="true">
<work_info>
<company_name>千橡互联</company_name>
<description>一家互联网公司</description>
<start_date>2006-01</start_date>
<end_date />
</work_info>
</work_history>
<university_history list="true">
<university_info>
<name>北京第二外国语学院</name>
<year>2003</year>
<department>人文学院</department>
</university_info>
</university_history>
<hs_history list="true">
<hs_info>
<name>黑龙江省实验中学</name>
<grad_year>1999</grad_year>
</hs_info>
</hs_history>
</user>
</users_getInfo_response>
[编辑] 返回JSON样例
[{ “uid”:222332 , ”name”:”Ramos” , ”sex”:1 , ”star”:1 ,”zidou”:1 ”birthday”:”2008-10-12”,
"email_hash”:” 650628530_9c6b2b93842c46155b75b14a34054924”,
“tinyurl”:” http://head.xiaonei.com/photos/tiny_10942g177.jpg”,
“headurl”:” http://head.xiaonei.com/photos/tiny_10942g177.jpg”,
“mainurl”:” http://head.xiaonei.com/photos/tiny_10942g177.jpg”,
“hometown_location”:{“country”:”中国”,”province”:”四川”,”city”:”乐山”},
”work_history”:[
{“company_name”:”千橡”,
”description”:”优秀的公司”,
”start_date”:”2008-7-7”,”end_date”:””}
],
“university_history”:[
{“name”:” 北京第二外国语学院”,”year”:2003,
“department”:” 人文学院”}
],
“hs_history”:[
{“name”:” 黑龙江省实验中学”,”grad_year”:1999}
],}]
[编辑] 返回参数
其中name代表fields里可传入的参数
| Name |
Description |
| <uid> |
表示用户id |
| <name> |
表示用户名 |
| <sex> |
表示性别,值1表示男性;值0表示女性 |
| <star> |
表示是否为星级用户,校内中值1表示是;值0表示不是,开心中0表示非真实姓名和头像,1表示非真实姓名,2表示非真实头像,3表示真实用户 |
| <zidou> |
表示是否为vip用户,值1表示是;值0表示不是 |
| <vip> |
表示是否为vip用户等级,前提是zidou节点必须为1 |
| <birthday> |
表示出生时间,格式为:yyyy-mm-dd,需要自行格式化日期显示格式 |
| <email_hash> |
用户经过验证的email的信息字符串:email通过了connect.registerUsers接口。字符串包含的email经过了crc32和md5的编码。 |
| <tinyurl> |
表示头像链接 50*50大小 |
| <headurl> |
表示头像链接 100*100大小 |
| <mainurl> |
表示头像链接 200*200大小 |
| <hometown_location> |
表示家乡信息 |
| <country>(子节点) |
表示所在国家 |
| <province>(子节点) |
表示所在省份 |
| <city>(子节点) |
表示所在城市 |
| <work_info> |
表示工作信息 |
| <company_name>(子节点) |
表示所在公司 |
| <description>(子节点) |
表示工作描述 |
| <start_date>(子节点) |
表示入职时间 |
| <end_date>(子节点) |
离职时间 |
| <university_info> |
表示就读大学信息 |
| <name>(子节点) |
表示大学名 |
| <year>(子节点) |
表示入学时间 |
| <department>(子节点) |
表示学院 |
| <hs_info> |
表示就读高中学校信息 |
| <name>(子节点) |
表示高中学校名 |
| <grad_year>(子节点) |
表示入学时间 |