This document describes how to call the group chat APIs to perform group chat operations. First, create an internal app. Then, use the group chat APIs to create a group chat, retrieve group chat information, manage the group chat, and modify the group chat.
Process overview
Step 1: Obtain the client ID and Client Secret of the app.
Step 3: Obtain the app access credential by following Obtain the access token of an internal app.
Step 4: Call the server-side group chat APIs.
-
Call the Server API for creating a group chat to create a group chat and obtain its
chatId.
-
Based on the
chatId, call the Server API Query group chat information to retrieve the group chat information.
-
Manage the group chat by using its chatId.
-
Based on the
chatId, call the new Server API Obtain the OpenConversationId of a group chat to obtain the openConversationId.
- Based on the
openConversationId, call the new Server API for setting group admins in batches to set group admins in batches.
-
Based on the
chatId, call the Server API for updating group admins to set group admins.
-
Based on the
chatId, call the Server API Turn off Private Chat to control whether group members can chat privately.
-
Based on the
chatId, call the Server API Update the group nickname of a group member to set the nickname of a group member.
-
Based on the
chatId, call the Server API Obtain the join chat QR Code link. Other users in your organization can click the link to request to join the group chat.
-
Based on the
chatId, call the Server API for updating a group chat to modify the group chat information.
Prerequisites
Complete the App creation and configuration process.
Step 1: Obtain the app credential
- Select the target app, go to the app details page, and click Basic Information > Credentials and Basic Information.
- Obtain the client ID and Client Secret of the app.
Step 2: Add API permissions
Click Development Configuration > Manage Permissions. In the permission search box, enter qyapi_chat_manage, qyapi_chat_read, and qyapi_chat_base_read separately, and request the permissions.
Step 3: Obtain the app access token
For details about the differences between Server APIs, see Legacy API VS New API. The following APIs all use the new Server API. For SDK download details, see Server-side SDK download.
Based on the client ID and Client Secret obtained in Step 1, obtain the app access credential by following Obtain the access token of an internal app.
Step 4: Call the server-side group chat APIs
-
Call the Server API for creating a group chat to create a group chat and obtain its chatId.
-
Based on the chatId, call the Server API Query group chat information to retrieve the group chat information.
-
Manage the group chat by using its chatId.
-
Based on the
chatId, call the new Server API Obtain the OpenConversationId of a group chat to obtain the openConversationId.
-
Based on the
openConversationId, call the new Server API for setting group admins in batches to set group admins in batches.
-
Based on the
chatId, call the Server API for updating group admins to set group admins.
-
Based on the
chatId, call the Server API Turn off Private Chat to control whether group members can chat privately.
-
Based on the
chatId, call the Server API Update the group nickname of a group member to set the nickname of a group member.
-
Based on the
chatId, call the Server API Obtain the join chat QR Code link. Other users in your organization can click the link to request to join the group chat.
-
Based on the
chatId, call the Server API for updating a group chat to modify the group chat information.