Account/update privacy/en

跳转到: 导航, 搜索

目录

account/update_privacy

Set privacy setting

URL

http://api.t.sina.com.cn/account/update_privacy.(json%7Cxml)

Supported Formats

XML/JSON

HTTP Request Method

POST

Requires Authentication

true
See the Authorization Mechanism Statement for authorization details

Requests Count Limitation

true
See the Interface Access Rights Statement for the Request Count Limitaiton details.

Request Parameters

  Requires Type and Range Description
source true string AppKey for the application to identify it. ( This parameter is not needed when using OAuth)
comment false int Who can comment this account’s status. 0:all users. 1: followings. Default value:0.
message false int Who can send direct message to this account. 0:all users. 1: followings. Default value: 1.
realname false int Whether allow other user find me by real name though the search engine. 0:allow. 1: not allow. Default value : 1.
geo false int Whether allow saving and displaying geo info in status. 0:allow. 1: not allow. Default value:0.
badge false int Medal status. -1: private. 0: public. Default value is 0.

Notes

None

Example Request

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

Response

XML Example

<?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 Example

{
    "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" : "北京 海淀区"
}

Others

None