Retrieving script details -- API

The GET method of the scripts  API retrieves the details of one synthetic script or all synthetic scripts.

  • Use getAll to retrieve details about all of your scripts.
  • Use getScriptMetaById to retrieve more in depth details of a single script.

 

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.
APIMethodDescription
Applications

GETRetrieve the details of applications
PUT

Update an existing application

POSTCreate a new application
DELETEDelete an application

Execution Plans



GETRetrieve the details of Execution Plans
PUT
DELETEDelete an Execution Plan
ScriptsGETRetrieve the details of scripts
LocationsGETRetrieve the details of all locations

Blackouts

POSTRetrieve the details of Blackouts
PUT
POSTActivate the Blackout
POSTDeactivate the Blackout
POSTDelete a Blackout

Time Frames

POSTRetrieve the details of Time Frames
PUT
POSTDelete Time Frames
 

To retrieve one script or all scripts

The scripts  API uses the GET method to retrieve the details of a script. Use the following request syntax:

 

For retrieving the details of a single script

https://<PresentationServerHostName>/tsws/10.0/api/appvis/synthetic/api/scripts/getScriptMetaById?scriptId=<SID>
 

For retrieving the details of all scripts

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

In the above examples:

  • <PresentationServerHostName>  indicates the host name of the TrueSight Presentation Server.
  • <SID> indicates the ID of the script.

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 script is:
    https://localhost/tsws/10.0/api/appvis/synthetic/api/scripts/getScriptMetaById?scriptId=3
  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 parameters

ElementDescription
authToken

Value of authToken

Query parameters
scriptIdID of the App Visibility Portal

Response

The following sample is the JSON code returned by the API for a for the Pinger script:

The following sample is the JSON code returned by the API for a for all scripts:

Response body parameters

The following table lists the parameters returned by the API for a single script:

ParameterDescriptionValue
name
File name of the scriptString
attributes
Attributes of the script run by the Execution Plan (can be multiple) 
    encrypted
Indicates whether the attribute is encrypted

0 - False

1 - True

    defaultValue
Default value of the attributeVaries depending on the attribute
    name
Name of the attributeString
    encryptionType
Type of encryption used for this attribute

0 - No encryption

1,2 - Indicates encryption type

    description
Description of the attributeString
    type
Data type of the attribute
  • boolean
  • float
  • number
  • string
    value
Value of the attributeVaries depending on the attribute
    order
Serial number of the appearance of the attribute in the user interfaceNumber
id
ID of the scriptNumber
version

Version number that is incremented each time there is a change in script attributes for custom scripts

App Visibility version number for default scripts

String

The following table lists the parameters returned by the API for all scripts:

ParameterDescriptionValue
createdAt
Time and date when the script was created, in UTC formatNumber
createdBy
Name of the user who uploaded the script to App VisibilityString
name
Name of the script file

String

projectDescription
Description of the project in Silk PerformerString
id
ID of the scriptNumber
projectName
Name of the project in Silk PerformerString
version

Version number that is incremented each time there is a change in script attributes for custom scripts

App Visibility version number for default scripts

String

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

Comments