Batch Create Department

2020-03-24 13:54:16
John Ten
3125
Last edited by Taotao on 2020-03-24 13:55:54
Share links
Summary : Request this method to add departments in bulk.
Method Description

Request this method to add departments in bulk.

Example
public function addDept()
{
    include_once('../vendor/zentao/zentao.php');
    $zentao = new \zentao();
    $params = array(
        'parentDeptID' => '1',
        'depts'        => array('Department D', 'Department F')
    );    // request parameters
    $result = $zentao->addDept($params);
    return $result;
}
Request
POST
Method addDept
Parameter
Name Type Required Description

parentDeptID

int

Optional

Parent Department ID

depts

array

Required

Department name added, e.g. 'depts' => array('Department D', 'Department F')

Result success error
{
    "status": 1,
    "msg": "success",
    "result": []
}
{
    "status": 0,
    "msg": "error",
    "result": []
}
Write a Comment
Comment will be posted after it is reviewed.