POST/:user/lists
(→:user/lists) |
|||
第1行: | 第1行: | ||
− | + | {{api_desc2| | |
− | 创建一个新的list,每个用户最多能够创建20个。 | + | uri=:user/lists| |
− | + | desc=创建一个新的list,每个用户最多能够创建20个。| | |
− | = | + | format=XML/JSON| |
− | + | httpMethod=POST| | |
− | + | needAuth=true| | |
− | = | + | rateLimit=true| |
− | + | params={{api_args|:user|true|int64/string|要创建的List所属的用户ID或者用户昵称。}} | |
− | + | {{api_args|name|true|string|要创建的List的名称,不超过10个汉字,20个半角字符。}} | |
− | + | {{api_args|mode|false|string|创建的list是公共的(public)还是私有的(private),默认为private。}} | |
− | POST | + | {{api_args|description|false|string|描述信息。70个汉字。140个半角字符。}} |
− | + | {{api_args|disp|false|int|是否在首页显示,1为显示,0为不显示。默认为0。}}| | |
− | = | + | getParam=| |
− | true | + | postParam=-d "name=我的好友&mode=private&disp=1"| |
− | + | result= | |
− | + | ===XML示例=== | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | = | + | |
− | = | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | === | + | |
<pre> | <pre> | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<list> | <list> | ||
− | <id> | + | <id>201012140011271539</id> |
− | <name> | + | <name>我的好友</name> |
− | <full_name>@ | + | <full_name>@siegetest/我的好友</full_name> |
− | <slug> | + | <slug>我的好友</slug> |
− | <description/> | + | <description>null</description> |
<subscriber_count>0</subscriber_count> | <subscriber_count>0</subscriber_count> | ||
<member_count>0</member_count> | <member_count>0</member_count> | ||
− | <uri>/ | + | <uri>/siegetest/我的好友</uri> |
− | <mode> | + | <mode>private</mode> |
<user> | <user> | ||
− | <id> | + | <id>1854740027</id> |
− | <screen_name> | + | <screen_name>siegetest</screen_name> |
− | <name> | + | <name>siegetest</name> |
<province>11</province> | <province>11</province> | ||
<city>8</city> | <city>8</city> | ||
<location>北京 海淀区</location> | <location>北京 海淀区</location> | ||
− | <description></description> | + | <description>ABCDE</description> |
− | <url | + | <url/> |
− | <profile_image_url>http:// | + | <profile_image_url>http://tp4.sinaimg.cn/1854740027/50/1291272213/1</profile_image_url> |
− | <domain | + | <domain/> |
<gender>m</gender> | <gender>m</gender> | ||
− | <followers_count> | + | <followers_count>2</followers_count> |
− | <friends_count> | + | <friends_count>20</friends_count> |
− | <statuses_count> | + | <statuses_count>39</statuses_count> |
<favourites_count>0</favourites_count> | <favourites_count>0</favourites_count> | ||
− | <created_at> | + | <created_at>Thu Nov 11 00:00:00 +0800 2010</created_at> |
<following>false</following> | <following>false</following> | ||
<verified>false</verified> | <verified>false</verified> | ||
− | <allow_all_act_msg> | + | <allow_all_act_msg>true</allow_all_act_msg> |
− | <geo_enabled> | + | <geo_enabled>true</geo_enabled> |
</user> | </user> | ||
</list> | </list> | ||
</pre> | </pre> | ||
− | + | ===JSON示例=== | |
− | === | + | |
<pre> | <pre> | ||
{ | { | ||
− | " | + | "subscriber_count" : 0, |
− | " | + | "description" : "null", |
− | " | + | "full_name" : "@siegetest/我的好友2", |
− | "member_count": 0, | + | "member_count" : 0, |
− | "mode": " | + | "mode" : "private", |
− | " | + | "user" : |
− | " | + | { |
− | + | "name" : "siegetest", | |
− | + | "domain" : "", | |
− | + | "geo_enabled" : true, | |
− | " | + | "followers_count" : 2, |
− | " | + | "statuses_count" : 39, |
− | " | + | "favourites_count" : 0, |
− | "description": " | + | "city" : "8", |
− | " | + | "description" : "ABCDE", |
− | " | + | "verified" : false, |
− | " | + | "id" : 1854740027, |
− | + | "gender" : "m", | |
− | "friends_count": | + | "friends_count" : 20, |
− | " | + | "screen_name" : "siegetest", |
− | " | + | "allow_all_act_msg" : true, |
− | " | + | "following" : false, |
− | " | + | "url" : "", |
− | + | "profile_image_url" : "http://tp4.sinaimg.cn/1854740027/50/1291272213/1", | |
− | "profile_image_url": "http:// | + | "created_at" : "Thu Nov 11 00:00:00 +0800 2010", |
− | " | + | "province" : "11", |
− | " | + | "location" : "北京 海淀区" |
− | " | + | }, |
− | + | "slug" : "我的好友2", | |
− | + | "uri" : "/siegetest/我的好友2", | |
− | + | "id" : 221012140011299900, | |
+ | "name" : "我的好友2" | ||
} | } | ||
− | </pre> | + | </pre>| |
+ | useAge= | ||
+ | * 重复创建同名分组将给出400错误。| | ||
+ | otherInfo=无 | ||
+ | }} |
2010年12月14日 (二) 16:39的版本
目录 |
:user/lists
创建一个新的list,每个用户最多能够创建20个。
URL
http://api.t.sina.com.cn/:user/lists.(json%7Cxml)
支持格式
XML/JSON
HTTP请求方式
POST
是否需要登录
true
关于授权机制,参见授权机制声明
请求数限制
true
关于请求数限制,参见接口访问权限说明
请求参数
必选 | 类型及范围 | 说明 | |
---|---|---|---|
source | true | string | 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数) |
:user | true | int64/string | 要创建的List所属的用户ID或者用户昵称。 |
name | true | string | 要创建的List的名称,不超过10个汉字,20个半角字符。 |
mode | false | string | 创建的list是公共的(public)还是私有的(private),默认为private。 |
description | false | string | 描述信息。70个汉字。140个半角字符。 |
disp | false | int | 是否在首页显示,1为显示,0为不显示。默认为0。 |
注意事项
- 重复创建同名分组将给出400错误。
返回结果
XML示例
<?xml version="1.0" encoding="UTF-8"?> <list> <id>201012140011271539</id> <name>我的好友</name> <full_name>@siegetest/我的好友</full_name> <slug>我的好友</slug> <description>null</description> <subscriber_count>0</subscriber_count> <member_count>0</member_count> <uri>/siegetest/我的好友</uri> <mode>private</mode> <user> <id>1854740027</id> <screen_name>siegetest</screen_name> <name>siegetest</name> <province>11</province> <city>8</city> <location>北京 海淀区</location> <description>ABCDE</description> <url/> <profile_image_url>http://tp4.sinaimg.cn/1854740027/50/1291272213/1</profile_image_url> <domain/> <gender>m</gender> <followers_count>2</followers_count> <friends_count>20</friends_count> <statuses_count>39</statuses_count> <favourites_count>0</favourites_count> <created_at>Thu Nov 11 00:00:00 +0800 2010</created_at> <following>false</following> <verified>false</verified> <allow_all_act_msg>true</allow_all_act_msg> <geo_enabled>true</geo_enabled> </user> </list>
JSON示例
{ "subscriber_count" : 0, "description" : "null", "full_name" : "@siegetest/我的好友2", "member_count" : 0, "mode" : "private", "user" : { "name" : "siegetest", "domain" : "", "geo_enabled" : true, "followers_count" : 2, "statuses_count" : 39, "favourites_count" : 0, "city" : "8", "description" : "ABCDE", "verified" : false, "id" : 1854740027, "gender" : "m", "friends_count" : 20, "screen_name" : "siegetest", "allow_all_act_msg" : true, "following" : false, "url" : "", "profile_image_url" : "http://tp4.sinaimg.cn/1854740027/50/1291272213/1", "created_at" : "Thu Nov 11 00:00:00 +0800 2010", "province" : "11", "location" : "北京 海淀区" }, "slug" : "我的好友2", "uri" : "/siegetest/我的好友2", "id" : 221012140011299900, "name" : "我的好友2" }
其他
无