DuliDuli Open Platform
EN
简体中文
繁體中文
English
Quick Start APIs DuliDuli Official Website
模板

Create Department


Request Method

POST http://[SERVER:9022]/v1/org/create_dept?access_token={access_token}


Request Example

{
"org_id": "$org_id",
"dept_name": "$dept_name",
"parent_id": "$parent_dept_id",
"sort_id": $sort_id,
"dept_head_list":[$account_id_1,$account_id_2],
"display_in_org": true
}


Request Parameters

Parameters

Type

Required

Description

org_id

string

Y

Organization ID

dept_name

string

Y

Department Name. Cannot exceed 32 characters (including Chinese characters and English letters)

parent_id

string

Y

Parent Department ID. The root department ID is 0

sort_id

int

Y

Integer. Sort order within the parent department. The smaller the value, the higher the priority. Enter 0 to auto-generate. Duplicate values are not allowed among sibling departments (global uniqueness is recommended)

dept_head_list

string[]

N

Department Heads, multiple IDs separated by English commas [accountid1,account_id_2].

display_in_org

boolean

N

Display in Address Book

true: Yes

false: No


Return:

{
"code": 0,
"msg": "ok",
"data": {
"dept_id": "$dept_id"
}
}

Fields

Type

Desc

dept_id

string

Department ID


Error Codes

code

message

Desc

100080

Invalid dept name

Invalid dept name

100081

Invalid dept id

Invalid dept id

100082

Invalid sort id

Invalid sort id

100083

parent dept not exisit

parent dept not exisit

100084

Invalid parameters

Invalid parameters

More Global Codes