Description
This document describes the ISPnext API entry point for authentication. This entry point is needed to gain access to every other entry point and method in VL_API.
General
The authentication entry point contains a method for login, which returns an accessToken, and a renewalToken, which can be used to renew an expired accessToken.
Authentication Reference
Methods
POST Login
Location
Body
{ "u":"username", "p":"password" }
Response
There are two possible responses. The first is for the situation where the login has succeeded and the response will contain the accessToken required for other requests. The second is for the situation where the user needs to login on another server. The response will then contain the new hostname.
Authentication succeeded:
{ "userId": 9999999, "displayName": "Demo User", "accessToken": string, "renewalToken": string, "hostname": "XXX.vendorlink.nl" }
Reauthenticat on other server:
{ "hostname": "ZZZ.vendorlink.nl" }
Remarks
The value of "accesToken" in the response should be saved and passed with subsequent requests to VL_API. The value of "renewalToken" should be saved to get a new accessToken without the need to resubmit username and password, once the accessToken has expired.
Please note that the renewalToken can be used only once.
POST ExtendToken
Location
Header
- Key "Authorization", Value "Bearer <accessToken>"
- Key "Content-Type", Value "application/json: charset=utf8"
Body
{ "rToken": string }
Response
{ "userId": 9999999, "displayName": "Demo User", "accessToken": string, "renewalToken": string }