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 Endpoints

Description

Obtains the authToken required to perform all other operations

Retrieves configuration data of monitor instances

Retrieves performance data of monitor instances

TSWS APIs that use the GET method

API Endpoints

Description

Retrieves a list of monitored devices

Retrieves a list of monitored instances 

Retrieves a list of monitor types 

Retrieves a list of tenants 

Request syntax

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

Request parameters

Element

Description

username

User name performing the operation

password

Password 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

rest_Login_v110.png

JSON response content

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

Object

Description

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 code

Description

Sample JSON

Troubleshooting tips

200

Success

{
   "responseTimeStamp": "2017-05-08T19:29:18",
   "statusCode": "200",
   "statusMsg": "OK",
   "response":
   {
     "authToken": "_daa8939f-41a6-4f8e-bcc0-b3b230e72244",
     "authPassed": true,
     "status": "OK"
   }
}

Not applicable.

401

Invalid credentials

{
  "responseTimeStamp": "2017-05-09T01:24:43",
  "statusCode": "401",
  "statusMsg": "Invalid username/password",
  "response":
  {
    "authPassed": false,
    "status": "FAILED"
  }
}

Specify valid credentials and try again.

500

Internal 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.

503

Remedy 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.

400

Missing 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.

400

Missing 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