Blocks/create

跳转到: 导航, 搜索
 
(未显示1个用户的2个中间版本)
第1行: 第1行:
== blocks/create ==
+
{{api_desc2|
将用户加入黑名单
+
uri=blocks/create|
 
+
desc=将某用户加入登录用户的黑名单|
=== URL: ===
+
format=XML/JSON|
http://api.t.sina.com.cn/blocks/create.format
+
httpMethod=POST|
 
+
needAuth=true|
===格式:===
+
rateLimit=true|
xml, json
+
params={{api_args|user_id|true|int64|要加入黑名单的用户ID}}
+
{{api_args|screen_name|false|string|要加入黑名单的用户微博昵称}}|
===请求方式: ===
+
getParam=|
POST
+
postParam=-d "user_id=12345"|
+
result=
===是否需要身份验证:===
+
===XML示例===
true
+
 
+
===请求数限制:===
+
true
+
 
+
===请求参数:===
+
必选参数(至少选一个)
+
*user_id:要加入黑名单的用户ID。
+
o 示例:  http://api.t.sina.com.cn/blocks/create.xml?user_id=1401881
+
 
+
*screen_name:要加入黑名单的用户微博昵称,可选。 
+
o 示例: http://api.t.sina.com.cn/blocks/create.xml?screen_name=101010
+
 
+
===使用说明===
+
user_id或screen_name若不存在返回400
+
 
+
===返回结果: ===
+
XML :
+
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<user>
 
<user>
   <id>1833448730</id>
+
   <id>12345</id>
   <screen_name>LoopF1</screen_name>
+
   <screen_name>a12bcdc_h8f</screen_name>
   <name>LoopF1</name>
+
   <name>a12bcdc_h8f</name>
   <province>11</province>
+
   <province>0</province>
   <city>8</city>
+
   <city>0</city>
   <location>北京 海淀区</location>
+
   <location/>
 
   <description/>
 
   <description/>
 
   <url/>
 
   <url/>
   <profile_image_url>http://tp3.sinaimg.cn/1833448730/50/0/1</profile_image_url>
+
   <profile_image_url>http://tp2.sinaimg.cn/12345/50/0/0</profile_image_url>
 
   <domain/>
 
   <domain/>
   <gender>m</gender>
+
   <gender>f</gender>
   <followers_count>0</followers_count>
+
   <followers_count>2</followers_count>
 
   <friends_count>0</friends_count>
 
   <friends_count>0</friends_count>
 
   <statuses_count>0</statuses_count>
 
   <statuses_count>0</statuses_count>
 
   <favourites_count>0</favourites_count>
 
   <favourites_count>0</favourites_count>
   <created_at>Tue Sep 28 00:00:00 +0800 2010</created_at>
+
   <created_at>Tue Dec 15 00:00:00 +0800 2009</created_at>
 
   <following>false</following>
 
   <following>false</following>
 
   <verified>false</verified>
 
   <verified>false</verified>
第55行: 第37行:
 
</user>
 
</user>
 
</pre>
 
</pre>
 
+
===JSON示例===
JSON:
+
 
<pre>
 
<pre>
 
{
 
{
     "name" : "LoopF1",
+
     "name" : "a12bcdc_h8f",
 
     "domain" : "",
 
     "domain" : "",
 
     "geo_enabled" : true,
 
     "geo_enabled" : true,
     "followers_count" : 0,
+
     "followers_count" : 2,
 
     "statuses_count" : 0,
 
     "statuses_count" : 0,
 
     "favourites_count" : 0,
 
     "favourites_count" : 0,
     "city" : "8",
+
     "city" : "0",
 
     "description" : "",
 
     "description" : "",
 
     "verified" : false,
 
     "verified" : false,
     "id" : 1833448730,
+
     "id" : 12345,
     "gender" : "m",
+
     "gender" : "f",
 
     "friends_count" : 0,
 
     "friends_count" : 0,
     "screen_name" : "LoopF1",
+
     "screen_name" : "a12bcdc_h8f",
 
     "allow_all_act_msg" : false,
 
     "allow_all_act_msg" : false,
 
     "following" : false,
 
     "following" : false,
 
     "url" : "",
 
     "url" : "",
     "profile_image_url" : "http://tp3.sinaimg.cn/1833448730/50/0/1",
+
     "profile_image_url" : "http://tp2.sinaimg.cn/12345/50/0/0",
     "created_at" : "Tue Sep 28 00:00:00 +0800 2010",
+
     "created_at" : "Tue Dec 15 00:00:00 +0800 2009",
     "province" : "11",
+
     "province" : "0",
     "location" : "北京 海淀区"
+
     "location" : ""
 
}
 
}
 
</pre>
 
</pre>
 
+
{{Param_user}}|
=== 字段说明===
+
useAge=
user
+
如果user_id或者screen_name均未提供,则返回400错误。|
 
+
otherInfo=
* id: 用户UID
+
}}
* screen_name: 微博昵称
+
* name: 友好显示名称,如Bill Gates
+
* province: 省份编码(参考省份编码表)
+
* city: 城市编码(参考城市编码表)
+
* location:地址
+
* description: 个人描述
+
* url: 用户博客地址
+
* profile_image_url: 自定义图像
+
* domain: 用户个性化URL
+
* gender: 性别,m--男,f--女,n--未知
+
* followers_count: 粉丝数
+
* friends_count: 关注数
+
* statuses_count: 微博数
+
* favourites_count: 收藏数
+
* created_at: 创建时间
+
* following: 是否已关注
+
* verified: 加V标示,是否微博认证用户
+
 
+
 
+
===使用示例: ===
+
json:
+
 
+
curl -u uid:password  http://api.t.sina.com.cn/blocks/create.json -d "source=appkey&user_id=1234567"
+
 
+
xml:
+
 
+
curl -u uid:password  http://api.t.sina.com.cn/blocks/create.xml -d "source=appkey&user_id=1234567"
+

2012年9月24日 (一) 11:44的最后版本

目录

blocks/create

将某用户加入登录用户的黑名单

URL

http://api.t.sina.com.cn/blocks/create.(json%7Cxml)

支持格式

XML/JSON

HTTP请求方式

POST

是否需要登录

true
关于授权机制,参见授权机制声明

请求数限制

true
关于请求数限制,参见接口访问权限说明

请求参数

  必选 类型及范围 说明
source true string 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数)
user_id true int64 要加入黑名单的用户ID
screen_name false string 要加入黑名单的用户微博昵称

注意事项

如果user_id或者screen_name均未提供,则返回400错误。

返回结果

XML示例

<?xml version="1.0" encoding="UTF-8"?>
<user>
  <id>12345</id>
  <screen_name>a12bcdc_h8f</screen_name>
  <name>a12bcdc_h8f</name>
  <province>0</province>
  <city>0</city>
  <location/>
  <description/>
  <url/>
  <profile_image_url>http://tp2.sinaimg.cn/12345/50/0/0</profile_image_url>
  <domain/>
  <gender>f</gender>
  <followers_count>2</followers_count>
  <friends_count>0</friends_count>
  <statuses_count>0</statuses_count>
  <favourites_count>0</favourites_count>
  <created_at>Tue Dec 15 00:00:00 +0800 2009</created_at>
  <following>false</following>
  <verified>false</verified>
  <allow_all_act_msg>false</allow_all_act_msg>
  <geo_enabled>true</geo_enabled>
</user>

JSON示例

{
    "name" : "a12bcdc_h8f",
    "domain" : "",
    "geo_enabled" : true,
    "followers_count" : 2,
    "statuses_count" : 0,
    "favourites_count" : 0,
    "city" : "0",
    "description" : "",
    "verified" : false,
    "id" : 12345,
    "gender" : "f",
    "friends_count" : 0,
    "screen_name" : "a12bcdc_h8f",
    "allow_all_act_msg" : false,
    "following" : false,
    "url" : "",
    "profile_image_url" : "http://tp2.sinaimg.cn/12345/50/0/0",
    "created_at" : "Tue Dec 15 00:00:00 +0800 2009",
    "province" : "0",
    "location" : ""
}

字段说明 - user

  • id: 用户UID
  • screen_name: 微博昵称
  • name: 友好显示名称,同微博昵称
  • province: 省份编码(参考省份编码表)
  • city: 城市编码(参考城市编码表)
  • location:地址
  • description: 个人描述
  • url: 用户博客地址
  • profile_image_url: 自定义图像
  • domain: 用户个性化URL
  • gender: 性别,m--男,f--女,n--未知
  • followers_count: 粉丝数
  • friends_count: 关注数
  • statuses_count: 微博数
  • favourites_count: 收藏数
  • created_at: 创建时间
  • following: 是否已关注(此特性暂不支持)
  • verified: 加V标示,是否微博认证用户

其他

文档更新时间: 2012-09-24