Retrieving locations -- API


The GET method of the locations API retrieves your locations.

 

Before you begin

You must obtain an authToken by using the login API. The token authenticates the user performing the operation. For details, see TSWS authentication.

Synthetic configuration APIs

Notes:

  • If you have upgraded to version 11.3.02, you can access the Synthetic Blackout and Synthetic Time Frames APIs listed in this table.
  • If you are using version 11.3.01 or earlier, you can continue to use the Execution Plan APIs to access the Blackouts.
API
Method
Description
Applications

GET
Retrieve the details of applications
PUT
Update an existing application
POST
Create a new application
DELETE
Delete an application
Execution Plans

GET
Retrieve the details of Execution Plans
PUT
DELETE
Delete an Execution Plan
Scripts
GET
Retrieve the details of scripts
Locations
GET
Retrieve the details of all locations
Blackouts
POST
Retrieve the details of Blackouts
PUT
POST
Activate the Blackout
POST
Deactivate the Blackout
POST
Delete a Blackout
Time Frames
POST
Retrieve the details of Time Frames
PUT
POST
Delete Time Frames
 

To retrieve locations

The locations  API uses the GET method to retrieve locations. Use the following request syntax:

 

https://<PresentationServerHostName>/tsws/10.0/api/appvis/synthetic/api/locations/getAll

In the above example,  <PresentationServerHostName>  indicates the host name of the TrueSight Presentation Server.

Sample request with REST client

After accessing the REST client, perform the following steps:

  1. Enter the URL for the API.
    An example of a request for a single Execution Plan is:

    https://localhost/tsws/10.0/api/appvis/synthetic/api/locations/getAll

  2. Add a new header row and select Authorization as the header type.
  3. Enter the text authToken followed by the authToken generated through the login API. 
  4. Click Send.

Request parameter

Element

Description

authToken

Value of authToken

Response

The following sample is the JSON code returned by the API for two locations.

{
"data" : [2]
0 : {
"name" : "Loc0"
"id" : 1
}
1 : {
"name" : "Loc1"
"id" : 2
}
}

Response body parameters

Parameter

Description

Value

name

Name of the location

String

id

IdD of the location

Number

 

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