Authorization
This endpoint is used to obtain an authentication token from the server, as well as to set an expiration date and time for the token.
Get Access Token
Description:
This request will result in a token generated by the server if successful. The token is a long random string, and must be provided for all following calls as a header element named x-connectfi-token
.
Request method and URL:
POST /auth/get-token
Request headers:
Request body example:
Response examples:
200 (HTTP response status code) -- Token is successfully created
{
"code": "0", //Code "0" means that the request was successful
"data": {
"token": "a long random string" //Token to be used for all subsequent calls
"dtsExpireAt": "2022-10-07T08:18:57.360Z" //Token expiration date
}
}
401 (HTTP response status code) -- Unauthorized
Using Authorization Token
In all subsequent requests, the token will need to be added into the request headers as a key:value pair with the key name "x-connectfi-token":
"x-connectfi-token": "a long random string"