tencent cloud

Feedback

Getting the Groups a User Has Joined

Last updated: 2024-02-07 17:15:28

    Feature Overview

    This API is used by app admins to obtain the list of groups a certain user has joined. The information of work groups (Work) and audio-video groups (AVChatRoom) that the user has joined but are not activated is not pulled by default.

    API Calling Description

    Applicable group types

    Group Type ID
    RESTful API Support
    Private
    Yes. Same as work groups (Work) in the new version. The information of work groups that the user has joined but are not activated is not returned by default.
    Public
    Yes
    ChatRoom
    Yes. Same as meeting groups (Meeting) in the new version.
    AVChatRoom
    Yes. The information of audio-video groups (AVChatRoom) that the user has joined is not returned by default. If you specify to pull audio-video group information, the obtained group information may not be complete. Audio-video groups do not store all group member data.
    Community
    Yes
    These are the preset group types in Chat. For more information, see Group System.

    Sample request URL

    https://xxxxxx/v4/group_open_http_svc/get_joined_group_list?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

    Request parameters

    The following table describes the modified parameters when this API is called. For other parameters, see RESTful API Overview.
    Parameter
    Description
    xxxxxx
    Domain name corresponding to the country/region where your SDKAppID is located.
    China: console.tim.qq.com
    Singapore: adminapisgp.im.qcloud.com
    Seoul: adminapikr.im.qcloud.com
    Frankfurt: adminapiger.im.qcloud.com
    Mumbai: adminapiind.im.qcloud.com
    Silicon Valley: adminapiusa.im.qcloud.com
    Jakarta: adminapiidn.im.qcloud.com
    v4/group_open_http_svc/get_joined_group_list
    Request API
    sdkappid
    SDKAppID assigned by the Chat console when an app is created
    identifier
    App admin account. For more information, see the App Admin section in Login Authentication.
    usersig
    Signature generated by the app admin account. For details, see Generating UserSig.
    random
    A random 32-bit unsigned integer ranging from 0 to 4294967295.
    contenttype
    Request format, which should always be json.

    Maximum call frequency

    200 calls per second

    Sample request

    Basic format A basic request is used to obtain the information about groups that a user has joined. The group information contains only the IDs of users in the group.
    {
    "Member_Account": "leckie"
    }
    Pulling by page You can use the Limit and Offset fields to control the pagination mode:
    The Limit field specifies the maximum number of groups in GroupIdList in the response packet, which cannot exceed 5,000.
    The Offset field specifies the sequence number of the group in the entire group list, starting from which the information is read. Offset is 0 by default. If pagination is requested (the page number starts from 1), the Offset value of each page should be: (Page number – 1) × Number of groups displayed on each page. For example, to display 20 group members on each page, the request parameters for the first page should be {"Limit": 20, "Offset": 0}, the request parameters for the second page should be {"Limit": 20, "Offset": 20}, and so on.
    The value of Limit or Offset does not affect TotalCount in the response packet.
    {
    "Member_Account": "leckie",
    "Limit": 10, // Number of groups to be pulled. If this field is not specified, all groups will be pulled.
    "Offset": 0 // Sequence number of the group starting from which information is pulled.
    }
    Specifying the group type You can specify the type of groups to be pulled, for example, Public (social networking group for strangers), Private (same as Work groups in the new version), and ChatRoom (same as Meeting groups in the new version). If AVChatRoom (audio-video group) is specified, you may obtain an incomplete list of members.
    {
    "Member_Account": "leckie",
    "GroupType" : "Public" // Type of groups to be pulled. If this parameter is not specified, all types of groups will be pulled.
    }
    Pulling specified information To specify the basic information fields to be pulled, set GroupBaseInfoFilter. To specify the group member information in the group that needs to be pulled, set SelfInfoFilter.
    {
    "Member_Account": "leckie",
    "WithHugeGroups":1, // Supports pulling the information of audio-video groups (AVChatRoom).
    "WithNoActiveGroups":1,// Supports pulling the information of Private groups (same as Work groups in the new version) that the user has joined but are not activated.
    "Limit": 10, // Number of groups to be pulled. If this field is not specified, all groups will be pulled.
    "Offset": 0, // Sequence number of the group starting from which information is pulled.
    "ResponseFilter": {
    "GroupBaseInfoFilter": [ // Basic information fields to be pulled
    "Type",
    "Name",
    "Introduction",
    "Notification"
    ],
    "SelfInfoFilter": [ // Member's personal information in the group
    "Role", // Role in the group
    "JoinTime" // Time when the member joined the group
    ]
    }
    }
    
    Pulling topic-enabled community groups
    {
    "Member_Account": "107867",// User account to be queried (required)
    "SupportTopic": 1// Whether the specified group type supports topics. This field is supported only by community groups.
    }
    ALL IN ONE
    {
    "Member_Account": "leckie",
    "WithHugeGroups":1,
    "WithNoActiveGroups":1,
    "ResponseFilter": {
    "GroupBaseInfoFilter": [
    "Type",
    "Name",
    "Introduction",
    "Notification",
    "FaceUrl",
    "CreateTime",
    "Owner_Account",
    "LastInfoTime",
    "LastMsgTime",
    "NextMsgSeq",
    "MemberNum",
    "MaxMemberNum",
    "ApplyJoinOption",
    "MuteAllMember"
    ],
    "SelfInfoFilter": [
    "Role",
    "JoinTime",
    "MsgFlag",
    "MsgSeq"
    ]
    }
    }

    Request fields

    Field
    Type
    Required
    Description
    Member_Account
    String
    Yes
    User account to be queried
    WithHugeGroups
    Integer
    No
    Whether to pull the information of audio-video groups (AVChatRoom) that the user has joined. 0: No (default value); 1: Yes
    WithNoActiveGroups
    Integer
    No
    Whether to pull the information of Private groups (same as Work groups in the new version) that the user has joined but are not activated. 0: No (default value); 1: Yes
    Limit
    Integer
    No
    Number of groups pulled each time. If no value is specified, all groups will be pulled.
    Offset
    Integer
    No
    Sequence number of the group starting from which information is pulled.
    GroupType
    String
    No
    Type of groups to be pulled, for example, Public (social networking group for strangers), Private (same as Work groups in the new version), ChatRoom (same as Meeting groups in the new version), AVChatRoom (audio-video groups), and Community. If no value is specified, all types of groups are pulled.
    ResponseFilter
    Object
    No
    It contains two filters: GroupBaseInfoFilter and SelfInfoFilter. GroupBaseInfoFilter specifies the basic information fields to pull. For more information, see Group basic information. SelfInfoFilter specifies members' personal information to be pulled from groups. For more information, see Group member profile.
    SupportTopic
    Integer
    No
    Whether the specified group type supports topics. 1: Yes; 0: No. If this field is specified, GroupType must be Community.

    Sample response

    Basic or paged pull request
    {
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0,
    "TotalCount": 2, // This value is the total number of groups that meet the conditions, regardless of the `Limit` and `Offset` settings.
    "GroupIdList": [
    {
    "GroupId": "@TGS#2J4SZEAEL"
    },
    {
    "GroupId": "@TGS#2C5SZEAEF"
    }
    ]
    }
    Specifying the group type
    {
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0,
    "TotalCount": 1,
    "GroupIdList": [
    {
    "GroupId": "@TGS#2J4SZEAEL"
    }
    ]
    }
    Pulling specified information
    {
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0,
    "TotalCount": 2,
    "GroupIdList": [
    {
    "GroupId": "@TGS#16UMONKGG",
    "Introduction": "",
    "Name": "d",
    "Notification": "",
    "SelfInfo": {
    "JoinTime": 1588148506,
    "Role": "Member"
    },
    "Type": "Private"
    },
    {
    "GroupId": "@TGS#3FCOX2MGW",
    "Introduction": "",
    "Name": "TestGroup",
    "Notification": "",
    "SelfInfo": {
    "JoinTime": 1588041114,
    "Role": "Member"
    },
    "Type": "ChatRoom"
    }
    ]
    }
    Pulling topic-enabled community groups
    {
    "ActionStatus": "OK",
    "ErrorInfo": "ok",
    "ErrorCode": 0,
    "TotalCount": 1,
    "GroupIdList": [
    {
    "GroupId": "@TGS#_@TGS#cMOQ7HIM62CD",
    "Type": "Community",
    "SupportTopic": 1,
    "GrossTopicNextMsgSeq": 3,
    "SelfInfo": {
    "GrossTopicReadSeq": 2
    }
    }
    ]
    }
    
    ALL IN ONE
    {
    "ActionStatus": "OK",
    "ErrorInfo": "",
    "ErrorCode": 0,
    "TotalCount": 1, // This value is the total number of groups that meet the conditions, regardless of the `Limit` and `Offset` settings.
    "GroupIdList": [
    {
    "ApplyJoinOption": "DisableApply",
    "CreateTime": 1585718204,
    "FaceUrl": "",
    "GroupId": "@TGS#16UMONKGG",
    "Introduction": "",
    "LastInfoTime": 1588148506,
    "LastMsgTime": 0,
    "MaxMemberNum": 200,
    "MemberNum": 1,
    "Name": "d",
    "NextMsgSeq": 2,
    "Notification": "",
    "Owner_Account": "",
    "SelfInfo": {
    "JoinTime": 1588148506,
    "MsgFlag": "AcceptAndNotify",
    "Role": "Member",
    "MsgSeq": 1
    },
    "MuteAllMember": "Off",
    "Type": "Private"
    }
    ]
    }

    Response fields

    Field
    Type
    Description
    ActionStatus
    String
    Request result. OK: successful; FAIL: failed
    ErrorCode
    Integer
    Error code. 0: Successful; other values: Failed
    ErrorInfo
    String
    Error information
    TotalCount
    Integer
    Number of groups that the user has joined
    GroupIdList
    Array
    Group information pulled. The returned result is the information filtered based on the filtering fields set in the filter. For more information on the fields, see Group Data Structure.

    Error Codes

    The returned HTTP status code for this API is always 200 unless a network error (such as error 502) occurs. The specific error code and details can be found in the response fields ErrorCode and ErrorInfo respectively. For public error codes (60000 to 79999), see Error Codes. The following table describes the error codes specific to this API:
    Error Code
    Description
    10002
    A system error occurred. Try again or contact technical support.
    10003
    The request command is invalid. Try again or contact technical support.
    10004
    A parameter is invalid. Check the ErrorInfo field in the response packet to see whether the required fields have been specified or whether the fields are set according to protocol requirements.
    10018
    The response packet length exceeds the maximum packet length of 1 MB because too much content was requested. Try to reduce the amount of data requested at a time.

    API Debugging Tool

    Use the RESTful API online debugging tool to debug this API.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support