- 1 Introduction
- 2 Extension Mechanism
- 2.1 Introduction
- 2.2 Add a Module
- 2.3 Extend control
- 2.4 Extend model
- 2.5 Extend view
- 2.6 Extend style sheet and JS
- 2.7 Extend language and configuration
- 2.8 Add Class Library
- 3 API Mechanism
- 4 Command Line
API Call for Open Authentication
- 2018-06-28 14:40:09
- Renee
- 9452
- Last edited by tengfei on 2019-12-19 10:22:37
Session login is involved when using API to integration. The following three steps will be required.
1. Get the session
First, use getSessionID to get the session.
- GET: ?m=api&f=getSessionID&t=json
- PATHINFO: api-getsessionid.json
The returned will be sessionName and sessionID.
The way to pass sessions to the server much be cookies or GET. The most simple way is to add $sessionName=$sessionID to the URL requested. For example, http://pms.zentao.net/index.json?zentaosid=xxxxxxx.
Note
The parameter of sid in the URL above can be set by $config->sessionVar in config.php. For example, set $config->sessionVar = 'zentaosid' in config/config.php of ZenTao.
2. User ID Authentication
Use login method in user module to authenticate user ID. Username and password are required to authenticate user ID, and should be passed to user-login in post method.
Variable names: account, password.
3. Call API
After user authentication, you can call API from the HTML page or getModel.
Note
It is only applied to ZenTao. Zsite or Zdoo doesn't support it.
https://icbdoilonline.com/#