Validating the token
Before you begin
You must have used the token API (POST) to obtain the authToken, which authenticates the user performing the operation. For details, see TSWS-authentication.
Request syntax
https://<PresentationServerName>/tsws/api/v10.1/token
Request Header parameters
Parameter | Description |
---|---|
authToken | Value of the authToken |
getTokenDetails | Set it to true or false. Setting it to true returns a response header when the request succeeds. Any value other than true is considered as false, and no details are returned in response. Note: If the authToken value passed is Admin and the getTokenDetails is set to true, then the behavior is same as setting it to false. |
Sample request with REST client
After accessing the REST client, perform the following steps:
- Enter the URL for the configuration data of monitor instances API. The generic format is:
https://<Presentation Server host name>/tsws/api/v10.1/token - Add a new header row and select authToken as the header type.
- Enter the text authToken followed by the authToken generated through the token API (POST).
The request body is blank. - (Optional) Add a new header row, name it as getTokenDetails.
- Enter the text getTokenDetails followed by the value True.
- Click Send.
Sample JSON response
The response information follows the standard HTTP response status codes.
Sample JSON response for the validate token API:
Status code | Description | Sample JSON | Troubleshooting tips |
---|---|---|---|
200 | Success | Header when getTokenDetails is false or no details are returned in response: { "responseTimeStamp": "2017-05-15T15:02:16", "statusCode": "200", "statusMsg": "OK" }
Header response when getTokenDetails is true: { "responseTimeStamp": "2017-05-15T15:02:16", "statusCode": "200", "statusMsg": "OK" { "response": { "tenantName:"*", "username":"admin" } } | Not applicable. |
400 | Missing token | { "responseTimeStamp": "2017-05-15T15:02:16", "statusCode": "400", "statusMsg": "Token is missing" } | Specify the authToken in the request header. |
404 | Expired token | { "responseTimeStamp": "2017-05-15T15:02:16", "statusCode": "404", "statusMsg": "Token expired, timeout occurred" } | Log in again using the token API (Post). |
Related topics