跳转到: 导航, 搜索
第10行: 第10行:
 
{{api_args|description|false|string|要创建的好友分组的描述,不超过70个汉字,140个半角字符。}}
 
{{api_args|description|false|string|要创建的好友分组的描述,不超过70个汉字,140个半角字符。}}
 
{{api_args|tags|false|string|要创建的好友分组的标签,多个之间用逗号分隔,最多不超过10个,每个不超过7个汉字,14个半角字符。}}
 
{{api_args|tags|false|string|要创建的好友分组的标签,多个之间用逗号分隔,最多不超过10个,每个不超过7个汉字,14个半角字符。}}
{{api_args|mode|false|string|好友分组的私有属性,private:私有分组(分组及成员仅自己可见)、public:公开分组(分组所有人可见,成员可见性由参数visible设置),默认为private。}}
+
|
{{api_args|visible|false|int|好友分组成员的可见范围,当且仅当参数mode为public时有效,0:组内成员可见、1:所有人可见,默认为0。}}|
+
 
result=
 
result=
 
<pre>
 
<pre>
 
{
 
{
     "id": 3404979794629010,
+
     "id": 3479298377907800,
     "idstr": "3404979794629010",
+
     "idstr": "3479298377907807",
     "name": "同事",
+
     "name": "分组测试以下",
     "mode": "private",
+
     "mode": "public",
     "visible": 0,
+
     "visible": 1,
 
     "like_count": 0,
 
     "like_count": 0,
 
     "member_count": 0,
 
     "member_count": 0,
     "description": "",
+
     "description": "分组public1",
     "tags": [],
+
     "tags": [
     "profile_image_url": "http://tp1.sinaimg.cn/1404376560/50/5629870687/1",
+
        "分组标签1",
 +
        "分组标签2"
 +
    ],
 +
     "profile_image_url": "http://tp2.sinaimg.cn/2489518277/50/5617069329/1",
 
     "user": {
 
     "user": {
         "id": 1404376560,
+
         "id": 2489518277,
         "idstr": "1404376560",
+
         "idstr": "2489518277",
         "screen_name": "zaku",
+
         "screen_name": "虎贲Geek",
         "name": "zaku",
+
         "name": "虎贲Geek",
 
         "province": "11",
 
         "province": "11",
         "city": "5",
+
         "city": "8",
         "location": "北京 朝阳区",
+
         "location": "北京 海淀区",
         "description": "微博开放平台产品。人生五十年,乃如梦如幻;有生斯有死,壮士复何憾。",
+
         "description": "",
         "url": "http://blog.sina.com.cn/zaku",
+
         "url": "",
         "profile_image_url": "http://tp1.sinaimg.cn/1404376560/50/5629870687/1",
+
         "profile_image_url": "http://tp2.sinaimg.cn/2489518277/50/5617069329/1",
         "profile_url": "zaku",
+
         "profile_url": "hubengeek",
         "domain": "zaku",
+
         "domain": "hubengeek",
 
         "weihao": "",
 
         "weihao": "",
 
         "gender": "m",
 
         "gender": "m",
         "followers_count": 1440,
+
         "followers_count": 25,
         "friends_count": 604,
+
         "friends_count": 141,
         "statuses_count": 3543,
+
         "statuses_count": 22,
         "favourites_count": 14,
+
         "favourites_count": 3,
         "created_at": "Fri Aug 28 00:00:00 +0800 2009",
+
         "created_at": "Thu Nov 24 10:27:36 +0800 2011",
 
         "following": false,
 
         "following": false,
 
         "allow_all_act_msg": false,
 
         "allow_all_act_msg": false,
第50行: 第52行:
 
         "verified": false,
 
         "verified": false,
 
         "verified_type": -1,
 
         "verified_type": -1,
        "status_id": 3453143964431400,
 
 
         "allow_all_comment": true,
 
         "allow_all_comment": true,
         "avatar_large": "http://tp1.sinaimg.cn/1404376560/180/5629870687/1",
+
         "avatar_large": "http://tp2.sinaimg.cn/2489518277/180/5617069329/1",
 
         "verified_reason": "",
 
         "verified_reason": "",
 
         "follow_me": false,
 
         "follow_me": false,
 
         "online_status": 0,
 
         "online_status": 0,
         "bi_followers_count": 286,
+
         "bi_followers_count": 2,
 
         "lang": "zh-cn"
 
         "lang": "zh-cn"
 
     },
 
     },
     "created_at": "Mon Jan 23 12:45:05 +0800 2012"
+
     "created_at": "Wed Aug 15 14:40:38 +0800 2012"
 
}
 
}
 
</pre>|
 
</pre>|
第66行: 第67行:
 
*每个用户最多能够创建20个好友分组;
 
*每个用户最多能够创建20个好友分组;
 
*重复创建同名分组将给出错误;
 
*重复创建同名分组将给出错误;
*用户自己创建的分组,相互之间名称不能重复;
+
*用户自己创建的分组,相互之间名称不能重复;|
*好友分组在创建时默认为私有分组,即分组及成员仅创建者自己可见;
+
*创建好友分组时,可指定创建为公开分组,分组为所有人可见,其成员是否可见由visible参数指定;
+
*参数visible,设置好友分组成员可见性,分为组内成员可见、所有人可见;|
+
 
otherInfo=无
 
otherInfo=无
 
}}{{#a:showgrade}}
 
}}{{#a:showgrade}}

2012年10月24日 (三) 16:18的版本

friendships/groups/create

创建好友分组

URL

https://api.weibo.com/2/friendships/groups/create.json

支持格式

JSON

HTTP请求方式

POST

是否需要登录


关于登录授权,参见 如何登录授权

访问授权限制

访问级别:高级接口(需要授权)
频次限制:
关于频次限制,参见 接口访问权限说明

请求参数

  必选 类型及范围 说明
access_token true string 采用OAuth授权方式为必填参数,OAuth授权后获得。
name true string 要创建的好友分组的名称,不超过10个汉字,20个半角字符。
description false string 要创建的好友分组的描述,不超过70个汉字,140个半角字符。
tags false string 要创建的好友分组的标签,多个之间用逗号分隔,最多不超过10个,每个不超过7个汉字,14个半角字符。

注意事项

  • 每个用户最多能够创建20个好友分组;
  • 重复创建同名分组将给出错误;
  • 用户自己创建的分组,相互之间名称不能重复;

调用样例及调试工具

API测试工具

返回结果

JSON示例

{
    "id": 3479298377907800,
    "idstr": "3479298377907807",
    "name": "分组测试以下",
    "mode": "public",
    "visible": 1,
    "like_count": 0,
    "member_count": 0,
    "description": "分组public1",
    "tags": [
        "分组标签1",
        "分组标签2"
    ],
    "profile_image_url": "http://tp2.sinaimg.cn/2489518277/50/5617069329/1",
    "user": {
        "id": 2489518277,
        "idstr": "2489518277",
        "screen_name": "虎贲Geek",
        "name": "虎贲Geek",
        "province": "11",
        "city": "8",
        "location": "北京 海淀区",
        "description": "",
        "url": "",
        "profile_image_url": "http://tp2.sinaimg.cn/2489518277/50/5617069329/1",
        "profile_url": "hubengeek",
        "domain": "hubengeek",
        "weihao": "",
        "gender": "m",
        "followers_count": 25,
        "friends_count": 141,
        "statuses_count": 22,
        "favourites_count": 3,
        "created_at": "Thu Nov 24 10:27:36 +0800 2011",
        "following": false,
        "allow_all_act_msg": false,
        "geo_enabled": true,
        "verified": false,
        "verified_type": -1,
        "allow_all_comment": true,
        "avatar_large": "http://tp2.sinaimg.cn/2489518277/180/5617069329/1",
        "verified_reason": "",
        "follow_me": false,
        "online_status": 0,
        "bi_followers_count": 2,
        "lang": "zh-cn"
    },
    "created_at": "Wed Aug 15 14:40:38 +0800 2012"
}

关于错误返回值与错误代码,参见 错误代码说明

返回字段说明

其他

相关问题

{{{relat_qa}}}


帮助中心 查看更多问题或提问


Language: [[{{{2/uri}}}|中文]]




api评价