# 邀请好友进群

[异步回调] 支持拉多个好友入群。拉多个好友入群则传多个好友id

请求方式:POST

请求地址:https://$basehost/gateway/qopen/InviterAccountJoinGroup

body参数

{
  "robot_id": "机器人id",
  "group_id": "群id",
  "account_id_list": [
    "好友id1"
  ],
  "reason": "邀请进群理由"
}
字段 类型 必填 说明
robot_id string 机器人id
group_id string 群id
account_id_list array 好友id数组(最大值40)
reason string 邀请进群理由

返回值:

{
    "data": {
        "serial_no": "",
        "fail_list": [],
        "fail_info_list": [
          {account_id: "acc1",desc: "xxx"},
        ]
    },
    "errcode": 0,
    "errmsg": "",
    "hint": ""
}

返回说明

字段 类型 说明
errcode int 状态码,0为正常,非0代表错误
errmsg string 错误信息
data json json返回值
   data.serial_no string 操作序列号
   data.fail_list array 无效id列表,与机器人非好友关系,好友已在群,id不存在,均为无效id
   data.fail_info_list json json返回值
     data.fail_info_list.account_id string 成员id
     data.fail_info_list.desc string 失败原因
hint string 请求日志ID

处理结果,异步返回值 encoding_content解密后的结构:

{
    "event_type": 40004,
    "serial_no": "",
    "err_code": 0,
    "err_msg": "success",
    "data":{
    	"robot_id":"机器人id",
    	"group_id":"群id",
    	"success_id_list":["进群成功的id"],
    	"fail_id_list":["进群失败的id"]
    }
}

说明

字段 类型 说明
event_type int 事件类型,40004
serial_no string 操作序列号
err_code int 状态码,0为正常,非0代表错误
err_msg string 错误信息
robot_id string 机器人id
group_id string 群id
success_id_list array 好友进群成功的id列表
fail_id_list array 好友进群失败的id列表

完整请求示例:

curl -X POST \
  https://$basehost/gateway/qopen/InviterAccountJoinGroup \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
  -d '{
        "robot_id": "机器人id",
        "group_id": "群id",
        "account_id_list": ["好友id1"],
        "reason": "邀请进群理由"
      }'
最后更新时间: 2024/6/17 18:24:09