Batch Create Department

2020-03-24 13:54:16
John Ten
1772
Final Edition:tengfei De 2020-03-24 13:55:54
Introduction: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": []
}
Commenter
Commentaires reçus après vérification。