TSWS authentication

The TrueSight Web Service (TSWS) token API (POST) is meant for authenticating a user identified by username, password, and tenant information provided through the request. It uses the POST method to perform the authentication and returns an authToken value in the JSON response. The user is identified for performing the subsequent operations by this authToken and must be specified in all subsequent TSWS API requests.

TSWS APIs that use the POST method
API EndpointsDescription
tokenObtains the authToken required to perform all other operations
configdataRetrieves configuration data of monitor instances
perfdataRetrieves performance data of monitor instances

TSWS APIs that use the GET method
API EndpointsDescription
devicesRetrieves a list of monitored devices
instances Retrieves a list of monitored instances 
monitortypesRetrieves a list of monitor types 
tenantsRetrieves a list of tenants 

Request syntax

https://<PresentationServerHostName>/tsws/api/v10.1/token

Request parameters

ElementDescription
usernameUser name performing the operation
passwordPassword to authenticate the user
tenantName

Tenant name as it appears in the TrueSight Presentation Server

Example: *

 

The request parameters in JSON format:

{
"username": "<user name>",
"password": "<password>",
"tenantName": "<tenant name>"
}

Sample request with REST client

JSON response content

The JSON response includes an authToken if the authentication is successful. You must use this authToken value for subsequent requests.

ObjectDescription
authToken
Value that you specify in subsequent TrueSight Web Services operations
authPassed
Value returned by the API. This can be either true or false.
True indicates a successful operation and false indicates a failed operation.
status
Status returned by the API. For example, if the status code is 200, the status returned is OK.

Sample JSON response and troubleshooting authentication API

The response information follows the standard HTTP response status codes. The following table contains Sample JSON response and the associated troubleshooting tips:

Status codeDescriptionSample JSONTroubleshooting tips
200Success
{
    "responseTimeStamp": "2017-05-08T19:29:18",
    "statusCode": "200",
    "statusMsg": "OK",
    "response":
    {
      "authToken": "_daa8939f-41a6-4f8e-bcc0-b3b230e72244",
      "authPassed": true,
      "status": "OK"
    }
}
Not applicable.
401Invalid credentials
{
   "responseTimeStamp": "2017-05-09T01:24:43",
   "statusCode": "401",
   "statusMsg": "Invalid username/password",
   "response":
   {
     "authPassed": false,
     "status": "FAILED"
   }
}
Specify valid credentials and try again.
500Internal Server error
{
  "responseTimeStamp": "2017-05-09T01:25:35",
  "statusCode": "500",
  "statusMsg": "Internal Server error",
  "response":
  {
     "authPassed": false,
     "status": "FAILED"
  }
} 

Try after some time or contact the TrueSight Presentation Server administrator.

503Remedy SSO is not accessible
{
 "responseTimeStamp":"2017-05-15T14:41:40",
 "statusCode": "503",
 "statusMsg": "Remedy SSO server is not accessible"
} 

Try after some time or contact the TrueSight Presentation Server administrator.

400Missing username
{
   "responseTimeStamp": "2017-05-09T01:27:39",
   "statusCode": "400",
   "statusMsg": "Username cannot be blank"
}
Specify a value for the username parameter.
400 Missing password
{
 "responseTimeStamp": "2017-05-09T01:28:19",
 "statusCode": "400",
 "statusMsg": "Password cannot be blank"
}
Specify a value for the password parameter.
400Missing tenant
{
  "responseTimeStamp": "2017-05-09T01:28:19",
  "statusCode": "400",
  "statusMsg": "Tenant name cannot be blank"
}
Specify a value for the tenant parameter.

Related topics

Developing

Was this page helpful? Yes No Submitting... Thank you

Comments