Adding Group Members

Last updated: 2020-09-01 17:27:36

    Feature Description

    Through this API, the app admin can add new members to a specified group.

    API Invocation Description

    Applicable group types

    Group Type Support This RESTful API
    Private Yes, identical to Work in the new version
    Public Yes
    ChatRoom Yes, identical to Meeting in the new version
    AVChatRoom No

    IM comes with the preceding four group types. For details, see Group Systems.


    AVChatRoom does not support this API. If you attempt to use API on AVChatRoom, error 10007 will be returned. You have to apply to join this group.

    Request URL example

    Request parameters

    The following table lists and describes only the parameters to be modified when this API is invoked. For details on other parameters, see RESTful API Overview.

    Parameter Description
    v4/group_open_http_svc/add_group_member The request API.
    sdkappid The SDKAppID assigned by the IM console when an app is created.
    identifier This must be the app admin account. For details, see App Admins.
    usersig The signature generated by the app admin account. For details, see Generating UserSig.
    random Enter a random 32-bit unsigned integer ranging from 0 to 4294967295.

    Maximum invocation frequency

    The maximum invocation frequency is 200 times per second.

    Request packet examples

    • Basic form
      Invites users to a group. A single request supports adding up to 500 members. By default, the backend will deliver group system notifications to all group members (except for Private groups or Work groups in the new version that have not been activated).

        "GroupId": "@TGS#2J4SZEAEL", // The group to be operated on (required)
        "MemberList": [ // A maximum of 500 members can be added at a time.
            "Member_Account": "tommy" // The ID of the group member to be added (required)
            "Member_Account": "jared"
    • Adding Members Silently
      When Silence is set to 1, the system will not notify anyone after successfully adding members.

        "GroupId": "@TGS#2J4SZEAEL", // Target group (required)
        "Silence": 1, // Whether to add members silently (optional)
        "MemberList": [ // A maximum of 500 members can be added at a time
            "Member_Account": "tommy" // ID of the group member to be added (required)
            "Member_Account": "jared"

    Request packet fields

    Field Type Attribute Description
    GroupId String Required The ID of the target group.
    Silence Integer Optional Whether to add members silently. 0: no. 1: yes. The default value is 0.
    MemberList Array Required The array of the group members to be added.
    Member_Account String Required The UserID of the group member to be added.

    Response packet example

        "ActionStatus": "OK",
        "ErrorInfo": "",
        "ErrorCode": 0,
        "MemberList": [
             "Member_Account": "tommy",
             "Result": 1 // The result of adding the member. 0: failed. 1: succeeded. 2: existed already.
             "Member_Account": "jared",
             "Result": 1

    Response packet fields

    Field Type Description
    ActionStatus String The request processing result. OK: succeeded. FAIL: failed.
    ErrorCode Integer The error code. 0: succeeded. Others: failed.
    ErrorInfo String Error information.
    MemberList Array The returned result of adding the group member.
    Member_Account String The returned UserID of the group member.
    Result Integer The result of adding the member. 0: failed. 1: succeeded. 2: existed already. 3: pending approval by the invitee.

    Error Codes

    Unless a network error (such as error 502) occurs, the HTTP return code for this API is always 200. ErrorCode and ErrorInfo in the response packet represent the actual error code and error information, respectively.
    For common error codes (60000 to 79999), see Error Codes.
    The following table describes the error codes specific to this API.

    Error Code Description
    10002 An internal server error occurred. In this case, try again.
    10003 The request command keyword is invalid.
    10004 A parameter is invalid. In this case, check whether request parameters are correct based on the error description.
    10005 The number of Member_Accounts in the request packet exceeds 300.
    10007 Operation permissions are insufficient. In this case, check whether the type of the group supports user invitation. For example, AVChatRoom and BChatRoom groups disallow anyone to invite others to the groups.
    10014 The user in the request cannot be added to the group because the group is already full. In this case, reduce the number of Member_Accounts in the request or change the value of the MaxMemberNum field in the basic group information. For information on the basic group information, see Basic Group Information.
    10010 The group does not exist or has been dismissed.
    10015 The group ID is invalid. In this case, check whether the group ID is correct.
    10016 The developer backend rejects this operation through a third-party callback.
    10019 The requested UserID does not exist. In this case, check whether all Member_Accounts in MemberList are correct.
    10026 The command keyword requested by SDKAppID is disabled. In this case, contact our customer service.
    10037 The number of groups that the invited user has joined exceeds the limit. In this case, check and delete the Member_Account that has joined excessive groups, or purchase an upgrade based on the actual need. For information on feature packages, see Feature Packages.

    API Commissioning Tool

    Use the online commissioning tool for RESTful APIs to commission this API.


    Deleting a group member (v4/group_open_http_svc/delete_group_member)

    Callback That May Be Triggered

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback