POST/:user/lists

跳转到: 导航, 搜索
(:user/lists)
第1行: 第1行:
== :user/lists ==
+
{{api_desc2|
创建一个新的list,每个用户最多能够创建20个。
+
uri=:user/lists|
 
+
desc=创建一个新的list,每个用户最多能够创建20个。|
=== URL===
+
format=XML/JSON|
http://api.t.sina.com.cn/:user/lists.format
+
httpMethod=POST|
+
needAuth=true|
=== 格式===
+
rateLimit=true|
xml, json
+
params={{api_args|:user|true|int64/string|要创建的List所属的用户ID或者用户昵称。}}
+
{{api_args|name|true|string|要创建的List的名称,不超过10个汉字,20个半角字符。}}
=== HTTP请求方式===
+
{{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示例===
false
+
 
+
===参数===
+
* name: 必选参数。10个汉字的长度(20个字符的长度),汉字、字母,横线(不能用下划线),其他字符自动替换成横线,名称不能重复。
+
* mode:可选参数。其值(values)可以是public或private,默认为public。
+
* description:可选参数。70个汉字。可填写全角、半角符号。
+
 
+
===使用示例===
+
====XML====
+
curl -u uid:password -d "source=appkey&name=testlist" http://api.t.sina.com.cn/testuser/lists.xml
+
 
+
====Json====
+
curl -u uid:password -d "source=appkey&name=testlist" http://api.t.sina.com.cn/testuser/lists.json
+
 
+
===返回结果===
+
====XML====
+
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<list>
 
<list>
   <id>343</id>
+
   <id>201012140011271539</id>
   <name>testlist</name>
+
   <name>我的好友</name>
   <full_name>@testuser/testlist</full_name>
+
   <full_name>@siegetest/我的好友</full_name>
   <slug>testlist</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>/testuser/testlist</uri>
+
   <uri>/siegetest/我的好友</uri>
   <mode>public</mode>
+
   <mode>private</mode>
 
   <user>
 
   <user>
     <id>1642466141</id>
+
     <id>1854740027</id>
     <screen_name>testuser</screen_name>
+
     <screen_name>siegetest</screen_name>
     <name>testuser</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>http://tuoniao.org</url>
+
     <url/>
     <profile_image_url>http://tp2.sinaimg.cn/1642466141/50/1281523744</profile_image_url>
+
     <profile_image_url>http://tp4.sinaimg.cn/1854740027/50/1291272213/1</profile_image_url>
     <domain>testuser</domain>
+
     <domain/>
 
     <gender>m</gender>
 
     <gender>m</gender>
     <followers_count>41</followers_count>
+
     <followers_count>2</followers_count>
     <friends_count>55</friends_count>
+
     <friends_count>20</friends_count>
     <statuses_count>41</statuses_count>
+
     <statuses_count>39</statuses_count>
 
     <favourites_count>0</favourites_count>
 
     <favourites_count>0</favourites_count>
     <created_at>Fri Aug 28 00:00:00 +0800 2009</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>false</allow_all_act_msg>
+
     <allow_all_act_msg>true</allow_all_act_msg>
     <geo_enabled>false</geo_enabled>
+
     <geo_enabled>true</geo_enabled>
 
   </user>
 
   </user>
 
</list>
 
</list>
 
</pre>
 
</pre>
 
+
===JSON示例===
====Json====
+
 
<pre>
 
<pre>
 
{
 
{
     "description": "",  
+
     "subscriber_count" : 0,
     "full_name": "@testuser/testlist",  
+
     "description" : "null",
     "id": 344,  
+
     "full_name" : "@siegetest/我的好友2",
     "member_count": 0,  
+
     "member_count" : 0,
     "mode": "public",  
+
     "mode" : "private",
     "name": "testlist",
+
     "user" :  
     "slug": "testlist",  
+
     {
    "subscriber_count": 0,  
+
        "name" : "siegetest",
    "uri": "/testuser/testlist",  
+
        "domain" : "",
    "user": {
+
        "geo_enabled" : true,
         "allow_all_act_msg": false,  
+
        "followers_count" : 2,
         "city": "8",  
+
         "statuses_count" : 39,
         "created_at": "Fri Aug 28 00:00:00 +0800 2009",  
+
         "favourites_count" : 0,
         "description": "\u53ef\u60b2\u7684\u4e2d\u56fd\u4e92\u8054\u7f51\u4ece\u4e1a\u8005\uff0c\u4e0d\u660e\u771f\u76f8\u7684\u7fa4\u4f17\u3002",  
+
         "city" : "8",
         "domain": "testuser",  
+
         "description" : "ABCDE",
         "favourites_count": 0,  
+
         "verified" : false,
         "followers_count": 41,
+
         "id" : 1854740027,
        "following": false,  
+
         "gender" : "m",
         "friends_count": 55,  
+
         "friends_count" : 20,
         "gender": "m",  
+
         "screen_name" : "siegetest",
         "geo_enabled": false,  
+
         "allow_all_act_msg" : true,
         "id": 1642466141,  
+
         "following" : false,
         "location": "\u5317\u4eac \u6d77\u6dc0\u533a",
+
         "url" : "",
        "name": "testuser",  
+
         "profile_image_url" : "http://tp4.sinaimg.cn/1854740027/50/1291272213/1",
         "profile_image_url": "http://tp2.sinaimg.cn/1642466141/50/1281523744",  
+
         "created_at" : "Thu Nov 11 00:00:00 +0800 2010",
         "province": "11",  
+
         "province" : "11",
         "screen_name": "testuser",  
+
         "location" : "北京 海淀区"
         "statuses_count": 41,  
+
    },
        "url": "http://tuoniao.org",  
+
    "slug" : "我的好友2",
        "verified": false
+
    "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"
}

其他