API Call for Open Authentication

2018-06-28 14:05:39
Renee
383
Last edited by Renee on 2018-07-02 10:56:01

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. User name and password are required to authenticate user ID, and should be passed to user-login in post method.

Variable names: account, passwaord.


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 Renee@cnezsoft.com or liukun@cnezsoft.com.



Write a Comment
Comment will be posted once reviewed.