Validating the token
The TrueSight Web Service (TSWS) token
API (GET) is meant for validating whether the user session identified by the authToken provided through the request is still active or not. The user session is created using the token API (POST). It uses the GET method to validate the token for the logged in user.
API Endpoints | Description |
---|---|
devices | Retrieves a list of monitored devices |
instances | Retrieves a list of monitored instances |
monitortypes | Retrieves a list of monitor types |
tenants | Retrieves a list of tenants |
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:
Header response when getTokenDetails is true:
| Not applicable. |
400 | Missing token |
| Specify the authToken in the request header. |
404 | Expired token |
| Log in again using the token API (Post). |
Comments
Log in or register to comment.