Skip to content

users.show

lisztli edited this page Dec 19, 2011 · 6 revisions

#GET /users/show

返回好友或未设置隐私用户的信息

##路径

http://api.fanfou.com/users/show.[json|xml|rss]

##调用方法

GET

##限制条件

用户登录, 目标用户为登录用户关注者或未设置隐私

##参数:

###id

  • 作用: 指定需要浏览的用户id

  • 格式: id=user_id

  • 字段说明: 可选

###mode

  • 作用: 当mode=default(默认)时,返回消息中用户信息包含用户自定义profile.mode=lite, profile不会包含在返回信息中

  • 格式: mode=[default|lite]

  • 字段说明: 可选

###format

  • 作用: 当format=html时,返回消息中@提到的用户,网址等输出html链接

  • 格式: format=html

  • 字段说明: 可选

###callback

  • 作用: 当使用json格式时,生成的json对象将作为参数传给指定的javascript函数

  • 格式: callback=javascript函数名

  • 字段说明: 可选

##返回结果

###成功

  • HTTP Status Code

    200 OK HTTP/1.1

  • 返回值

    • json格式

      json格式解释请见下方示例

##示例

###请求URL

GET http://api.fanfou.com/users/show.json

###返回结果

{
    "id": "test",
    "name": "测试昵称",
    "screen_name": "测试昵称",
    "location": "北京 海淀区",
    "gender": "男",
    "birthday": "2105-03-11",
    "description": "测试帐号",
    "profile_image_url": "http://avatar3.fanfou.com/s0/00/5n/sk.jpg?1320913295",
    "profile_image_url_large": "http://avatar3.fanfou.com/l0/00/5n/sk.jpg?1320913295",
    "url": "http://fanfou.com/test",
    "protected": true,
    "followers_count": 9,
    "friends_count": 16,
    "favourites_count": 23,
    "statuses_count": 124,
    "following": false,
    "notifications": false,
    "created_at": "Sat Jun 09 23:56:33 +0000 2007",
    "utc_offset": 28800,
    "profile_background_color": "#ffffe5",
    "profile_text_color": "#004040",
    "profile_link_color": "#ff0000",
    "profile_sidebar_fill_color": "#ffefbf",
    "profile_sidebar_border_color": "#ffac80",
    "profile_background_image_url": "http://avatar.fanfou.com/b0/00/5n/sk_1320749993.jpg",
    "profile_background_tile": true,
    "status": {
        "created_at": "Thu Nov 10 09:37:34 +0000 2011",
        "id": "XRFWGErKgGI",
        "text": "这是神马?",
        "source": "<a href=\"http://abc.fanfouapps.com\" target=\"_blank\">ABC</a>",
        "truncated": false,
        "in_reply_to_lastmsg_id": "",
        "in_reply_to_user_id": "",
        "favorited": false,
        "in_reply_to_screen_name": ""
        }
}

###字段说明

字段返回值 字段类型 字段说明
id string 用户id
name string 用户姓名
screen_name string 用户昵称
location string 用户地址
gender string 用户性别
birthday string 用户生日信息
description string 用户自述
profile_image_url string 用户头像地址
profile_image_url_large string 用户高清头像地址
url string 用户页面地址
protected boolean 用户是否设置隐私保护
followers_count int 用户关注用户数
friends_count int 用户好友数
favourites_count int 用户收藏消息数
statuses_count int 用户消息数
following boolean 该用户是被当前登录用户关注
notifications boolean 当前登录用户是否已对该用户发出关注请求
created_at string 用户注册时间
utc_offset int ref: UTC offset
profile_background_color string 用户用户自定义页面背景颜色
profile_text_color string 用户用户自定义文字颜色
profile_link_color string 用户用户自定义链接颜色
profile_sidebar_fill_color string 用户用户自定义侧边栏颜色
profile_sidebar_border_color string 用户用户自定义侧边栏边框颜色
profile_background_image_url string 用户用户自定义背景图片地址
profile_background_tile boolean 是否平铺用户用户自定义背景图片地址
status object 用户发出的最后一条消息,其中各个字段参照Statuses Show中对应字段的解释
Clone this wiki locally