Obtaining user groups for the authenticated user


The TrueSight Web Service (TSWS) groups API is meant for obtaining the user groups information for the logged in user identified by token information provided through the request. It uses the GET method to obtain the user groups and returns them in the JSON response.

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 

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/groups

Request parameters

Element

Description

groups

User groups for the authenticated user.

Sample request with REST client

After accessing the REST client, perform the following steps:

  1. 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/groups
  2. Add a new header row and select authToken as the header type.
  3. Enter the text authToken followed by the authToken generated through the token API (POST).
    The request body is blank.
  4. Click Send.

Sample JSON response and Troubleshooting user groups 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-15T14:31:15",
 "statusCode": "200",
 "statusMsg": "OK",
 "usergroups":
    [
     "Administrators"
    ]
}

Not applicable.

400

Missing token

{
"responseTimeStamp":"2017-05-15T20:19:07",
"statusCode": "400",
"statusMsg": "Token is missing"
}

Specify the authToken in the request header.

401

Expired token

{
"responseTimeStamp": "2017-05-15T14:41:40",
"statusCode": "401",
"statusMsg": "Invalid/Expired token"
}

Log in again using the token API (Post).

500

Internal Server error

{   
"responseTimeStamp": "2017-05-15T14:41:40",
"statusCode": "500",
"statusMsg": "Internal server error"
}

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.

Related topics

Developing

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*