Skip to main content
Call this API to retrieve group settings and member information. It applies to scenarios where group admins view group settings and member information, or make group management decisions.

Request

Basic information
HTTP URLhttps://oapi.dingtalk.io/chat/get
HTTP MethodGET
Supported app typesappType-Internal app
Required permissionspermission-qyapi_chat_read-Read permission for basic information of DingTalk groups

Query parameters

NameTypeRequiredExampleDescription
access_tokenStringYes6d1bxxxxThe App credential used to call this API. Obtain it through the API for getting the access_token of an internal app.
chatidStringYeschate39f540dxxxxThe ID of the group chat. - Only supports the chatid returned by the Server-side Create group chat API. - Does not support the chatid obtained by calling the frontend JSAPI.

Request example

curl -X GET "https://oapi.dingtalk.io/chat/get" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=0d7e495xxxxa3f694fd6e' \
-d 'chatid=chatid'
Java
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.io/chat/get");
OapiChatGetRequest req = new OapiChatGetRequest();
req.setChatid("chate39f540dxxxx");
req.setHttpMethod("GET");
OapiChatGetResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
Python
import dingtalk.api

req=dingtalk.api.OapiChatGetRequest("https://oapi.dingtalk.io/chat/get")

req.chatid="chatid"
try:
  resp= req.getResponse(access_token)
  print(resp)
except Exception,e:
  print(e)
PHP
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');

$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_GET , DingTalkConstant::$FORMAT_JSON);
$req = new OapiChatGetRequest;
$req->setChatid("chatid");
$resp = $c->execute($req, $access_token, "https://oapi.dingtalk.io/chat/get");
C#
IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.io/chat/get");
OapiChatGetRequest req = new OapiChatGetRequest();
req.Chatid = "chatid";
req.SetHttpMethod("GET");
OapiChatGetResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);

Response

Response body

NameTypeExampleDescription
errcodeNumber0The return code.
errmsgStringokThe description of the return code.
chat_infoChatInfoThe group chat information.
nameStringAll-staff ChatThe group name.
ownerStringmanager4220The userId of the group owner.
useridlistString[][“user123”,“manager4220”]The list of userIds of group members.
conversationTagNumber2The conversation type: - 2: Organization group.
chatBannedTypeNumber0Whether Mute members is enabled for the group: - 0 (default): Not muted. - 1: Mute All.
searchableNumber0Whether the group can be searched: - 0 (default): Not searchable. - 1: Searchable.
validationTypeNumber0Whether verification is required to join the group: - 0 (default): No verification. - 1: Verification required.
mentionAllAuthorityNumber0The scope of @all: - 0 (default): Available to everyone. - 1: Only the group owner can use @all.
managementTypeNumber0The group management type: - 0 (default): Everyone can manage. - 1: Only the group owner can manage.
showHistoryTypeNumber0Whether new members can view the last 100 historical chats: - 1: Can view. - 0: Cannot view. If no value is passed, new members cannot view.
iconString@lADPDfJ6Q7LLejDNAljNAlgThe mediaID of the group Profile Photo.
statusNumber1The status. - 1: Normal. - 2: Dismissed.

Response body example

{
  "errcode":0,
  "errmsg":"ok",
  "chat_info":{
    "owner":"manager4220",
    "mentionAllAuthority":0,
    "showHistoryType":0,
    "chatid":"chate39f540dxxxx",
    "conversationTag":2,
    "validationType":0,
    "useridlist":[
      "user123",
      "manager4220"
    ],
    "icon":"@lADPDfJ6Q7LLejDNAljNAlg",
    "name":"All-staff Chat",
    "searchable":0,
    "chatBannedType":0,
    "managementType":0
  }
}

Error codes

If an error occurs when calling this API, find the solution in the Global error codes document based on the error message.
Error code (errorcode)Error message (errmsg)Solution
43007No permission to call this API.Confirm whether the access_token is generated by the current App.
49000The chatid parameter is required.Provide the chatid.
40001Invalid token.Confirm whether the access_token is correct.
70001The organization does not exist.Confirm whether the parameters are correct.
40016Invalid chatid.Confirm that the access_token and chatid belong to the same Organization.
-1System busy.Try again later.