Description
This document describes the Vendorlink 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": "A2ZDYyYmYwZjI1YWY1YFiZWRlNzUyN DJmMiIsImlzcyIInZkbG5rLW1hc3Rl ceyJ0eXAiOiJKV1QiLJhbGciOiJIUz I1NiJ9. yJzaWQiOiIwOGQ3Mzi40MGZkZXYubW UiLCJleHAiOjE1Njc1MTg2NjYsIm5i ZiI6MTU2NzUxNDc2Nn0. 3HcK9YftrOy1bNUCnHXWR2- 1kSPArAxOy7hPrOHzRcU", "renewalToken": "Lf/ bwPaKKIcerC3J8F7hdXkj4UnNfpM8e EvY28VdU+ xGB0O2FTxtkUUuBnFKfGLh", "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.
POST ExtendToken
Location
Header
- Key "Authorization", Value "Bearer <accessToken>"
Body
{ "RenewalToken":"Lf/bwPaKKIcerC3J8F7hdXkj4UnNfpM8e EvY28VdU+ xGB0O2FTxtkUUuBnFKfGLh" }
Response
{ "userId": 9999999, "displayName": "Demo User", "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIzI 1NiJ9. eyJzaWQiOiwOGQ3MzA2ZDYyYmwZjI1 YWY1YWFiZWRlNzUyNDJmMiIsImlzcy I6InZkbG5rLW1hc3Rlci40MGZkZXYu bWUiLCJleHAiOjE1Njc1MTg2NjYsIm 5iZiI6MTU2NzUxNDc2Nn0. 3HcK9YftrOy1bNUCnHXWR2- 1kSPArAxOy7hPrOHzRcU", "renewalToken": null }
Comments
0 comments
Please sign in to leave a comment.