Blocks/create

跳转到: 导航, 搜索
(创建新页面为 '== blocks/create == Blocks the user specified in the ID parameter as the authenticating user. Destroys a friendship to the blocked user if it exists. Returns the blocked user in…')
 
(blocks/create)
第1行: 第1行:
 
== blocks/create ==
 
== blocks/create ==
Blocks the user specified in the ID parameter as the authenticating user. Destroys a friendship to the blocked user if it exists. Returns the blocked user in the requested format when successful.  You can find out more about blocking in the Twitter Support Knowledge Base.
+
将用户加入黑名单
  
 
=== URL: ===
 
=== URL: ===
 
http://api.t.sina.com.cn/blocks/create/id.format
 
http://api.t.sina.com.cn/blocks/create/id.format
 
   
 
   
===Formats:===
+
===格式:===
 
xml, json
 
xml, json
 
   
 
   
=== HTTP Method(s): ===
+
===请求方式: ===
 
POST
 
POST
 
   
 
   
===Requires Authentication (about authentication):===
+
===是否需要身份验证:===
 
true
 
true
  
===API rate limited (about rate limiting):===
+
===请求数限制:===
false
+
true
  
===Parameters:===
+
===请求参数:===
One of the following is required:
+
必选参数(至少选一个)
* id.  Optional.  The ID or screen_name of the potentially blocked user.
+
*user_id:要加入黑名单的用户ID。
o Example: http://api.t.sina.com.cn/blocks/create/bob.xml
+
o 示例:  http://api.t.sina.com.cn/blocks/create.xml?user_id=1401881  
* user_id. Optional.  Specfies the ID of the potentially blocked user. Helpful for disambiguating when a valid user ID is also a valid screen name.
+
screen_name:要加入黑名单的用户微博昵称,可选。  
o Example: http://api.t.sina.com.cn/blocks/create.xml?user_id=1401881  
+
o 示例: http://api.t.sina.com.cn/blocks/create.xml?screen_name=101010  
* screen_name. Optional.  Specfies the screen name of the potentially blocked user. Helpful for disambiguating when a valid screen name is also a user ID.
+
o Example: http://api.t.sina.com.cn/blocks/create.xml?screen_name=101010  
+
  
===Response (about return values): ===
+
===返回结果: ===
XML example (truncated):
+
XML :
<?xml version="1.0" encoding="UTF-8"?>
+
 
  <user>
 
  <user>
<id>1401881</id>
+
  <id>1266321801</id>
<name>Doug Williams</name>
+
  <screen_name>姚晨</screen_name>
<screen_name>dougw</screen_name>
+
  <name>姚晨</name>
<location>San Francisco, CA</location>
+
  <province>11</province>
<description>Twitter API Support. Internet, greed, users, dougw and opportunities are my passions.</description>
+
  <city>5</city>
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/59648642/avatar_normal.png</profile_image_url>
+
  <location>北京 朝阳区</location>
<url>http://www.igudo.com</url>
+
  <description>一颗很逊的卤蛋。</description>
<protected>false</protected>
+
  <url>http://blog.sina.com.cn/yaochen</url>
<followers_count>1031</followers_count>
+
  <profile_image_url>http://tp2.sinaimg.cn/1266321801/50/1283203855</profile_image_url>
<profile_background_color>9ae4e8</profile_background_color>
+
  <domain>yaochen</domain>
<profile_text_color>000000</profile_text_color>
+
  <gender>f</gender>
<profile_link_color>0000ff</profile_link_color>
+
  <followers_count>3284142</followers_count>
<profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color>
+
  <friends_count>620</friends_count>
<profile_sidebar_border_color>87bc44</profile_sidebar_border_color>
+
  <statuses_count>2361</statuses_count>
<friends_count>293</friends_count>
+
  <favourites_count>14</favourites_count>
<created_at>Sun Mar 18 06:42:26 +0000 2007</created_at>
+
  <created_at>Fri Aug 28 00:00:00 +0800 2009</created_at>
<favourites_count>0</favourites_count>
+
  <following>false</following>
<utc_offset>-18000</utc_offset>
+
  <verified>true</verified>
<time_zone>Eastern Time (US & Canada)</time_zone>
+
  <allow_all_act_msg>false</allow_all_act_msg>
<profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2752608/twitter_bg_grass.jpg</profile_background_image_url>
+
  <geo_enabled>true</geo_enabled>
<profile_background_tile>false</profile_background_tile>
+
  <status>
<statuses_count>3390</statuses_count>
+
    <created_at>Mon Oct 18 11:44:53 +0800 2010</created_at>
<notifications>false</notifications>
+
    <id>3141808011</id>
<following>false</following>
+
    <text>冕冕,加油!</text>
<verified>true</verified>
+
    <source>
<status>
+
      <a href="http://news.sina.com.cn/wap/wbclient.html#3">iPhone客户端</a>
<created_at>Tue Apr 07 22:52:51 +0000 2009</created_at>
+
    </source>
<id>1472669360</id>
+
    <favorited>false</favorited>
<text>At least I can get your humor through tweets. RT @abdur: I don't mean this in a bad way, but genetically speaking your a cul-de-sac.</text>
+
    <truncated>false</truncated>
<source><a href="http://www.tweetdeck.com/">TweetDeck</a></source>
+
    <geo/>
<truncated>false</truncated>
+
    <in_reply_to_status_id/>
<in_reply_to_status_id></in_reply_to_status_id>
+
    <in_reply_to_user_id/>
<in_reply_to_user_id></in_reply_to_user_id>
+
    <in_reply_to_screen_name/>
<favorited>false</favorited>
+
    <retweeted_status>
<in_reply_to_screen_name></in_reply_to_screen_name>
+
      <created_at>Mon Oct 18 10:06:57 +0800 2010</created_at>
</status>
+
      <id>3140482259</id>
</user>
+
      <text>刚跑完100米圣途,蓮花山清幽的山徑,闊葉榕很高兴,我也很高兴。出山门了,这是我的"潮流"!答应妈妈了,要送给她!</text>
 +
      <source>
 +
        <a href="http://news.sina.com.cn/wap/wbclient.html#3">iPhone客户端</a>
 +
      </source>
 +
      <favorited>false</favorited>
 +
      <truncated>false</truncated>
 +
      <geo/>
 +
      <in_reply_to_status_id/>
 +
      <in_reply_to_user_id/>
 +
      <in_reply_to_screen_name/>
 +
      <thumbnail_pic>http://ss3.sinaimg.cn/thumbnail/3f1622c9492daa18d5612&amp;690</thumbnail_pic>
 +
      <bmiddle_pic>http://ss3.sinaimg.cn/bmiddle/3f1622c9492daa18d5612&amp;690</bmiddle_pic>
 +
      <original_pic>http://ss3.sinaimg.cn/orignal/3f1622c9492daa18d5612&amp;690</original_pic>
 +
      <user>
 +
        <id>1058415305</id>
 +
        <screen_name>行者孙冕</screen_name>
 +
        <name>行者孙冕</name>
 +
        <province>44</province>
 +
        <city>1</city>
 +
        <location>广东 广州</location>
 +
        <description/>
 +
        <url>http://blog.sina.com.cn/sunmian</url>
 +
        <profile_image_url>http://tp2.sinaimg.cn/1058415305/50/1279874506</profile_image_url>
 +
        <domain>sunmian</domain>
 +
        <gender>m</gender>
 +
        <followers_count>64184</followers_count>
 +
        <friends_count>409</friends_count>
 +
        <statuses_count>2269</statuses_count>
 +
        <favourites_count>32</favourites_count>
 +
        <created_at>Fri Aug 28 00:00:00 +0800 2009</created_at>
 +
        <following>false</following>
 +
        <verified>true</verified>
 +
        <allow_all_act_msg>false</allow_all_act_msg>
 +
        <geo_enabled>true</geo_enabled>
 +
      </user>
 +
    </retweeted_status>
 +
  </status>
 +
</user>
 +
 
 +
JSON:
  
 
===Usage examples: ===
 
===Usage examples: ===

2010年10月18日 (一) 16:54的版本

目录

blocks/create

将用户加入黑名单

URL:

http://api.t.sina.com.cn/blocks/create/id.format

格式:

xml, json

请求方式:

POST

是否需要身份验证:

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

返回结果:

XML :

<user>
 <id>1266321801</id>
 <screen_name>姚晨</screen_name>
 <name>姚晨</name>
 <province>11</province>
 <city>5</city>
 <location>北京 朝阳区</location>
 <description>一颗很逊的卤蛋。</description>
 <url>http://blog.sina.com.cn/yaochen</url>
 <profile_image_url>http://tp2.sinaimg.cn/1266321801/50/1283203855</profile_image_url>
 <domain>yaochen</domain>
 <gender>f</gender>
 <followers_count>3284142</followers_count>
 <friends_count>620</friends_count>
 <statuses_count>2361</statuses_count>
 <favourites_count>14</favourites_count>
 <created_at>Fri Aug 28 00:00:00 +0800 2009</created_at>
 <following>false</following>
 <verified>true</verified>
 <allow_all_act_msg>false</allow_all_act_msg>
 <geo_enabled>true</geo_enabled>
 <status>
   <created_at>Mon Oct 18 11:44:53 +0800 2010</created_at>
   <id>3141808011</id>
   <text>冕冕,加油!</text>
   <source>
     <a href="http://news.sina.com.cn/wap/wbclient.html#3">iPhone客户端</a>
   </source>
   <favorited>false</favorited>
   <truncated>false</truncated>
   <geo/>
   <in_reply_to_status_id/>
   <in_reply_to_user_id/>
   <in_reply_to_screen_name/>
   <retweeted_status>
     <created_at>Mon Oct 18 10:06:57 +0800 2010</created_at>
     <id>3140482259</id>
     <text>刚跑完100米圣途,蓮花山清幽的山徑,闊葉榕很高兴,我也很高兴。出山门了,这是我的"潮流"!答应妈妈了,要送给她!</text>
     <source>
       <a href="http://news.sina.com.cn/wap/wbclient.html#3">iPhone客户端</a>
     </source>
     <favorited>false</favorited>
     <truncated>false</truncated>
     <geo/>
     <in_reply_to_status_id/>
     <in_reply_to_user_id/>
     <in_reply_to_screen_name/>
     <thumbnail_pic>http://ss3.sinaimg.cn/thumbnail/3f1622c9492daa18d5612&690</thumbnail_pic>
     <bmiddle_pic>http://ss3.sinaimg.cn/bmiddle/3f1622c9492daa18d5612&690</bmiddle_pic>
     <original_pic>http://ss3.sinaimg.cn/orignal/3f1622c9492daa18d5612&690</original_pic>
     <user>
       <id>1058415305</id>
       <screen_name>行者孙冕</screen_name>
       <name>行者孙冕</name>
       <province>44</province>
       <city>1</city>
       <location>广东 广州</location>
       <description/>
       <url>http://blog.sina.com.cn/sunmian</url>
       <profile_image_url>http://tp2.sinaimg.cn/1058415305/50/1279874506</profile_image_url>
       <domain>sunmian</domain>
       <gender>m</gender>
       <followers_count>64184</followers_count>
       <friends_count>409</friends_count>
       <statuses_count>2269</statuses_count>
       <favourites_count>32</favourites_count>
       <created_at>Fri Aug 28 00:00:00 +0800 2009</created_at>
       <following>false</following>
       <verified>true</verified>
       <allow_all_act_msg>false</allow_all_act_msg>
       <geo_enabled>true</geo_enabled>
     </user>
   </retweeted_status>
 </status>

</user>

JSON:

Usage examples:

cURL (about cURL):

curl -d "" http://api.t.sina.com.cn/blocks/create/dougw.xml