Modifying Basic Group Profiles

Last updated: 2020-03-11 15:37:04

PDF

Feature Description

The app admin can modify the basic information of a specified group through this API.

API Invocation Description

Applicable group types

Group Type Support This RESTful API
Private Yes
Public Yes
ChatRoom Yes
AVChatRoom Yes
BChatRoom Yes

IM supports the preceding five types of groups. For details, see Group Systems.

Request URL example

https://console.tim.qq.com/v4/group_open_http_svc/modify_group_base_info?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

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/modify_group_base_info Request API
sdkappid SDKAppID assigned by the IM console when an app is created
identifier It 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

  • Modifying the basic information of a group
    Modifies the basic information of a group, such as the group name and group announcements.

    {
      "GroupId": "@TGS#1NVTZEAE4", // Group whose basic information you want to modify (required)
      "Name": "NewName", // Group name (optional)
      "Introduction": "NewIntroduction", // Group introduction (optional)
      "Notification": "NewNotification", // Group announcement (optional)
      "FaceUrl": "http://this.is.new.face.url", // Group profile photo (optional)
      "MaxMemberNum": 500, // Maximum number of group members (optional)
      "ApplyJoinOption": "NeedPermission", // Method for applying to join the group (optional)
      "ShutUpAllMember": "On" // Mute all members: "On": enable, "Off": disable.
    }
  • Setting custom group information
    Sets custom field information for a group. By default, custom information is unavailable and needs to be enabled before use. For details, see the explanatory table of request packet fields.

    {
      "GroupId": "@TGS#1NVTZEAE4", // Group whose basic information you want to modify (required)
      "AppDefinedData": [ // Custom field (optional)
          {
              "Key": "GroupTestData1", // To-be-modified custom field Key
              "Value": "NewData"  // New value of the custom field
          }
      ]
    }
  • Deleting custom group information
    Deletes the custom field information that you have set for a group.

    {
      "GroupId": "@TGS#1NVTZEAE4", // Group whose basic information you want to modify (required)
      "AppDefinedData": [  // Custom field (optional)
          {
              "Key": "GroupTestData2",
              "Value": "" // If this parameter is empty, it indicates the custom field is to be deleted.
          }
      ]
    }
  • ALL IN ONE

    {
      "GroupId": "@TGS#2J4SZEAEL", // Group whose basic information you want to modify (required)
      "Name": "NewName", // Group name (optional)
      "Introduction": "NewIntroduction", // Group introduction (optional)
      "Notification": "NewNotification", // Group announcement (optional)
      "FaceUrl": "http://this.is.new.face.url", // Group profile photo (optional)
      "MaxMemberNum": 500, // Maximum number of group members (optional)
      "ApplyJoinOption": "NeedPermission", // Method for applying to join the group (optional)
      "ShutUpAllMember": "On", // Mute all members: "On": enable, "Off": disable.
      "AppDefinedData": [ // Custom field (optional)
          {
              "Key": "GroupTestData1", // To-be-modified custom field Key
              "Value": "NewData" // New value of the custom field
          },
          {
              "Key": "GroupTestData2",
              "Value": "" // If this parameter is empty, it indicates the custom field is to be deleted.
          }
      ]
    }

Request packet fields

Field Type Attribute Description
GroupId String Required The ID of the group whose basic information you want to modify.
Name String Optional The group name with a maximum length of 30 bytes.
Introduction String Optional The group introduction with a maximum length of 240 bytes.
Notification String Optional The group announcement with a maximum length of 300 bytes.
FaceUrl String Optional The group profile photo URL with a maximum length of 100 bytes.
MaxMemberNum Integer Optional The maximum number of group members, which is 6,000 at the maximum.
ApplyJoinOption String Optional The method for handling group requests, which can be FreeAccess (no restriction), NeedPermission (approval required), or DisableApply (no entry).
AppDefinedData Array Optional By default, this field is unavailable. For details on enabling group custom fields, see Custom Fields.

Response packet example

{
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0
}

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.

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 A server internal error occurred. In this case, try again.
10003 A request command keyword is invalid.
10004 A parameter is invalid. In this case, check whether request parameters are correct based on the error description.
10026 The command keyword requested by SDKAppID is disabled. In this case, contact customer service.
10007 Operation permissions are insufficient. In this case, check whether the operator is the app admin or whether the operator has the permission to modify the fields in the request.
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.
80001 The group member profile fails to pass the text security check. In this case, check whether the modified group member profile contains sensitive words.

API Commissioning Tool

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

References

Deleting a group member (v4/group_open_http_svc/delete_group_member)