Account/update privacy

跳转到: 导航, 搜索
(使用示例)
第31行: 第31行:
 
=== 返回结果 ===
 
=== 返回结果 ===
 
XML示例:
 
XML示例:
<?xml version="1.0" encoding="UTF-8"?>
+
<?xml version="1.0" encoding="UTF-8"?>
  <user>
+
<user>
  <id>11075</id>
+
  <id>1854740027</id>
  <screen_name>11075</screen_name>
+
  <screen_name>siegetest</screen_name>
  <name>11075</name>
+
  <name>siegetest</name>
  <province>广东</province>
+
  <province>11</province>
  <city>广州</city>
+
  <city>8</city>
  <location>广东 广州</location>
+
  <location>北京 海淀区</location>
  <description>blog: timyang.net</description>
+
  <description>ABCDE</description>
  <url>http://timyang.net</url>
+
  <url/>
  <profile_image_url>http:// portrait.sinaimg.cn/11075/50#.jpg</profile_image_url>
+
  <profile_image_url>http://tp4.sinaimg.cn/1854740027/50/0/1</profile_image_url>
  <domain></domain>
+
  <domain/>
  <gender></gender>
+
  <gender>m</gender>
  <followers_count>0</followers_count>
+
  <followers_count>3</followers_count>
  <friends_count>0</friends_count>
+
  <friends_count>20</friends_count>
  <statuses_count>0</statuses_count>
+
  <statuses_count>15</statuses_count>
  <favourites_count>0</favourites_count>
+
  <favourites_count>0</favourites_count>
  <created_at>Thu Jan 01 08:00:00 +0800 1970</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>
  <geo_enabled>false</geo_enabled>
+
  <allow_all_act_msg>false</allow_all_act_msg>
  <status>
+
  <geo_enabled>true</geo_enabled>
    <created_at>Fri Dec 25 17:57:27 +0800 2009</created_at>
+
  <status>
    <id>19093</id>
+
    <created_at>Wed Nov 24 18:16:19 +0800 2010</created_at>
    <text>测试中国</text>
+
    <id>3854498847</id>
    <source>
+
    <text>abcwerw</text>
      <a id="0" href="http://t.sina.com.cn">Web</a>
+
    <source>
    </source>
+
      <a href="">微博开放平台接口</a>
    <favorited>false</favorited>
+
    </source>
    <truncated>false</truncated>
+
    <favorited>false</favorited>
    <geo/>
+
    <truncated>false</truncated>
    <in_reply_to_status_id></in_reply_to_status_id>
+
    <geo/>
    <in_reply_to_user_id></in_reply_to_user_id>
+
    <in_reply_to_status_id/>
    <in_reply_to_screen_name></in_reply_to_screen_name>
+
    <in_reply_to_user_id/>
  </status>
+
    <in_reply_to_screen_name/>
  </user>
+
  </status>
 +
</user>
 +
 
  
 
JSON示例:
 
JSON示例:
  
  {"id":9448,
+
{
     "screen_name":"name_9448",
+
    "name" : "siegetest",
     "name":"name_9448",
+
     "domain" : "",
     "province":"0",
+
     "geo_enabled" : true,
     "city":"0",
+
    "followers_count" : 3,
     "location":"",
+
     "statuses_count" : 15,
     "description":"",
+
    "favourites_count" : 0,
     "url":"",
+
     "city" : "8",
    "profile_image_url":"http://tp1.sinaimg.cn/9448/50/0",
+
     "description" : "ABCDE",
     "domain":"9448",
+
     "verified" : false,
     "followers_count":30,
+
    "status" :
     "friends_count":0,
+
     {
     "statuses_count":0,
+
        "created_at" : "Wed Nov 24 18:16:19 +0800 2010",
     "favourites_count":0,
+
        "text" : "abcwerw",
     "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
        "truncated" : false,
     "following":false,
+
        "in_reply_to_status_id" : "",
     "geo_enabled":false,
+
        "in_reply_to_screen_name" : "",
    "verified":false
+
        "geo" : null,
  }
+
        "favorited" : false,
 +
        "in_reply_to_user_id" : "",
 +
        "id" : 3854498847,
 +
        "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
 +
    },
 +
     "id" : 1854740027,
 +
    "gender" : "m",
 +
     "friends_count" : 20,
 +
     "screen_name" : "siegetest",
 +
     "allow_all_act_msg" : false,
 +
     "following" : false,
 +
    "url" : "",
 +
    "profile_image_url" : "http://tp4.sinaimg.cn/1854740027/50/0/1",
 +
     "created_at" : "Thu Nov 11 00:00:00 +0800 2010",
 +
     "province" : "11",
 +
     "location" : "北京 海淀区"
 +
}
 +
 
  
 
=== 使用示例===
 
=== 使用示例===
  
 
* xml:
 
* xml:
curl -u uid:password http://api.t.sina.com.cn/account/get_privacy.xml -d "source=appkey"
+
curl -u uid:password http://api.t.sina.com.cn/account/update_privacy.xml -d "source=appkey&comment=0"
  
 
* json:
 
* json:
curl -u uid:password http://api.t.sina.com.cn/account/get_privacy.json -d "source=appkey"
+
curl -u uid:password http://api.t.sina.com.cn/account/update_privacy.json -d "source=appkey&comment=0"

2010年11月25日 (四) 11:26的版本

目录

account/update privacy

设置隐私信息

URL

http://api.t.sina.com.cn/account/update_privacy.format

格式

xml, json

HTTP请求方式

POST

是否需要身份验证

true

请求数限制

true

请求参数

badge 勋章展现状态,值—1私密状态,0公开状态,默认值0

返回结果

XML示例: <?xml version="1.0" encoding="UTF-8"?> <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/0/1</profile_image_url>
 <domain/>
 <gender>m</gender>
 <followers_count>3</followers_count>
 <friends_count>20</friends_count>
 <statuses_count>15</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>false</allow_all_act_msg>
 <geo_enabled>true</geo_enabled>
 <status>
   <created_at>Wed Nov 24 18:16:19 +0800 2010</created_at>
   <id>3854498847</id>
   <text>abcwerw</text>
   <source>
     <a href="">微博开放平台接口</a>
   </source>
   <favorited>false</favorited>
   <truncated>false</truncated>
   <geo/>
   <in_reply_to_status_id/>
   <in_reply_to_user_id/>
   <in_reply_to_screen_name/>
 </status>

</user>


JSON示例:

{

   "name" : "siegetest",
   "domain" : "",
   "geo_enabled" : true,
   "followers_count" : 3,
   "statuses_count" : 15,
   "favourites_count" : 0,
   "city" : "8",
   "description" : "ABCDE",
   "verified" : false,
   "status" : 
   {
       "created_at" : "Wed Nov 24 18:16:19 +0800 2010",
       "text" : "abcwerw",
       "truncated" : false,
       "in_reply_to_status_id" : "",
       "in_reply_to_screen_name" : "",
       "geo" : null,
       "favorited" : false,
       "in_reply_to_user_id" : "",
       "id" : 3854498847,
       "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
   },
   "id" : 1854740027,
   "gender" : "m",
   "friends_count" : 20,
   "screen_name" : "siegetest",
   "allow_all_act_msg" : false,
   "following" : false,
   "url" : "",
   "profile_image_url" : "http://tp4.sinaimg.cn/1854740027/50/0/1",
   "created_at" : "Thu Nov 11 00:00:00 +0800 2010",
   "province" : "11",
   "location" : "北京 海淀区"

}


使用示例

  • xml:

curl -u uid:password http://api.t.sina.com.cn/account/update_privacy.xml -d "source=appkey&comment=0"

  • json:

curl -u uid:password http://api.t.sina.com.cn/account/update_privacy.json -d "source=appkey&comment=0"