Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/role/add_role_group |
| HTTP Method | POST |
| Supported app types | appType-Internal app |
| Permissions required | permission-qyapi_manage_addresslist-Contacts data management permission |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 6d1bxxxx | The app credential used to call this API. Obtain it through the API for getting the access_token of an internal app. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| name | String | Yes | Manufacturing | The name of the role group. |
Request example
curl -X POST "https://oapi.dingtalk.io/role/add_role_group" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=e9df3de5-2ccb-4aaf-a685-04ba09fe746d' \
-d 'name=%E5%90%8D%E7%A7%B0'
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.io/role/add_role_group");
OapiRoleAddrolegroupRequest req = new OapiRoleAddrolegroupRequest();
req.setName("Manufacturing");
OapiRoleAddrolegroupResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiRoleAddrolegroupRequest("https://oapi.dingtalk.io/role/add_role_group")
req.name="Name"
try:
resp= req.getResponse(access_token)
print(resp)
except Exception,e:
print(e)
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');
$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiRoleAddrolegroupRequest;
$req->setName("Name");
$resp = $c->execute($req, $access_token, "https://oapi.dingtalk.io/role/add_role_group");
import dingtalk.api
req=dingtalk.api.OapiRoleAddrolegroupRequest("https://oapi.dingtalk.io/role/add_role_group")
req.name="Name"
try:
resp= req.getResponse(access_token)
print(resp)
except Exception,e:
print(e)
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The return code ID. |
| groupId | Number | 1560985325 | The ID of the created role group. |
Response body example
{
"errcode":0,
"groupId":1560985325,
"errmsg":"ok"
}