- 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
Introduction
- 2018-06-28 14:05:39
- Renee
- 9476
- Last edited by Taotao on 2018-07-02 10:56:01
- Share links
1. API introduction
API is based on HTTP. All returned data is saved as .json.
ZenTaoPHP has two mechanisms of API. One is to call from the page, the other one is to call through getModel.
2. Call from the page
When visiting a page developed in ZenTaoPHP, change .html in URL to .json, then you will get the data in .json. For example, http://pms.zentao.net/project-task-8.html. Change it to http://pms.zentao.net/project-task-8.json, and you will get the returned data in .json. If you use GET, change the parameter of t to json, http://pms.zentao.net/?m=project&f=task&t=json.
The returned data is done with json_encode twice. See the example as shown below"
$result = file_get_contents('http://pms.zentao.net/project-task-8.json'); $result = json_decode($($result); if($result->result == 'success' and md5($result->data) == $result->md5) { $data = json_decode($result->data); print_r($data); }First, check whether the result in the first level is right and whether md5 signature is right, then use json_decode to data.
3. Use getModle to call
It is limited to call from the page. It might return the data you don't want, so a getModel is offered in ZenTaoPHP to call.
First, add the privilege to the account that you will want it to call by the getModel. Then use getModel in API to get the open method of the model in any module.
Module name, method name and the parameters of the method are required in getModel. Use commas to separate each parameter. For example, key1=value1,key2=value2.
Take getUserBugPairs() in the module of Bug in ZenTao as an example.
- GET: ?m=api&f=getModel&module=bug&methodName=getUserBugPairs¶ms=account=$account
- PATH_INFO: api-getmodel-bug-getUserBugPairs-account=$account.json
Note
Use getModel to call is ONLY applied to ZenTao. Zsite or Zdoo is not supported yet.
If any questions, leave a message below. We will reply ASAP. Or shoot us an email at [email protected] or [email protected].
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]
Information which you have shared is good but I am in trouble in implementing it.