API Call for Open Authentication

2018-06-28 14:05:39
Renee
6090
Last edited by Taotao on 2019-12-19 09:55:43
Share links

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 in ZenTao. Zsite or Zdoo doesn't support it.



If any questions, leave a message below or shoot us an email at [email protected].



Write a Comment
Comment will be posted after it is reviewed.