- 1. API
- 2 Configuration
- 3. Department
-
4. User
- 4.1 Get Parameters of Add User
- 4.2 Add User
- 4.3 Get User List
- 5. Product
- 6. Project
-
7. Task
- 7.1 Get Task List
- 7.2 Get Task Optional Information
- 7.3 Add Task
- 7.4 Finish Task Optional Information
- 7.5 Finish Task
- 8. Bug
Add Product
- 2020-03-24 10:41:57
- John Ten
- 3685
- Last edited by Taotao on 2020-03-24 17:19:36
- Share links
| Method Description |
By requesting this method, you canadd a product, and specify the person in charge and set the product type and access control. Note: If the parameter acl=custom, you can pass additional parameters, e.g.'whitelist' => array(1, 2), and add the IDs in the privilege group to the whitelist. |
|||||||||||||||||||||||||||||||||||||||||||||
| Example |
public function addProduct()
{
include_once('../vendor/zentao/zentao.php');
$zentao = new \zentao();
$params = array(
'name' => 'product-200',
'code' => 'p200',
'line' => 0,
'PO' => 'lisi',
'QD' => 'zhangsan',
'RD' => 'wangwu',
'type' => 'normal',
'status' => 'normal',
'desc' => 'product description,product description',
'acl' => 'custom',
'whitelist' => array(1, 2)
); // request parameter
$result = $zentao->addProduct($params);
return $result;
}
|
|||||||||||||||||||||||||||||||||||||||||||||
| Request | POST | |||||||||||||||||||||||||||||||||||||||||||||
| Method |
addProduct |
|||||||||||||||||||||||||||||||||||||||||||||
| Parameter |
|
|||||||||||||||||||||||||||||||||||||||||||||
| Result |
success | error | ||||||||||||||||||||||||||||||||||||||||||||
{ "status": 1,
"msg": "success",
"result": "Saved"
}
|
{
"status": 0,
"msg": "error",
"result": {
"name": [
"『Product Name』 should not be empty."
]
}
}
|
|||||||||||||||||||||||||||||||||||||||||||||
Write a Comment
Support
- Book a Demo
- Tech Forum
- GitHub
- SourceForge
About Us
- Company
- Privacy Policy
- Term of Use
- Blogs
- Partners
Contact Us
- Leave a Message
- Email Us: [email protected]