Page tree

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 Open link .


Synthetic configuration APIs

APIMethodDescription
Applications

GETRetrieve the details of one application or all applications
PUT

Update an existing application

POSTCreate a new application
DELETEDelete an application
Execution Plans

  
GETRetrieve the details of one or more Execution Plans
PUTCreate a new Execution Plan or
Update an existing Execution Plan
DELETEDelete an Execution Plan
ScriptsGETRetrieve the details of one script or all scripts
LocationsGETRetrieve the details of all locations
 

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 Open link

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:

{
	"data" : {
		"name" : "Pinger.ltz"
		"attributes" : [5]
		0 : {
			"encrypted" : 0
			"defaultValue" : "1"
			"name" : "Number of Pings"
			"encryptionType" : 0
			"description" : "Number of pings to be sent"
			"type" : "number"
			"value" : "1"
			"order" : 2
		}
		 -
		1 : {
			"encrypted" : 0
			"defaultValue" : "Sv_ICMP Ping"
			"name" : "Timer Name"
			"encryptionType" : 0
			"description" : "Name of the ICMP Ping Timer"
			"type" : "string"
			"value" : "Sv_ICMP Ping"
			"order" : 4
		}
		2 : {
			"encrypted" : 0
			"defaultValue" : "1.000000000"
			"name" : "Ping Timeout"
			"encryptionType" : 0
			"description" : "Timeout value for the ping in seconds"
			"type" : "float"
			"value" : "1.000000000"
			"order" : 1
		}
		3 : {
			"encrypted" : 0
			"defaultValue" : ""
			"name" : "Host"
			"encryptionType" : 0
			"description" : "The host being monitored"
			"type" : "string"
			"value" : ""
			"order" : 0
		}
		4 : {
			"encrypted" : 0
			"defaultValue" : "32"
			"name" : "Data Size"
			"encryptionType" : 0
			"description" : " Size of the data package to be sent in bytes "
			"type" : "number"
			"value" : "32"
			"order" : 3
		}
		"id" : 3
		"projectName" : "Pinger"
		"version" : 10.7.00
	}
}

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

{
	"data" : [10]
	0 : {
		"createdAt" : 1456119902455
		"createdBy" : "dave"
		"name" : "PasswordChecker_Big_Timeout_with_attribute11.ltz"
		"projectDescription" : "Default Project"
		"id" : 28
		"projectName" : "PasswordChecker"
		"version" : "123456"
	}
	
	1 : {
		"createdAt" : 1456119903439
		"createdBy" : "dave"
		"name" : "PasswordChecker_Big_Timeout_with_attribute10.ltz"
		"projectDescription" : "Default Project"
		"id" : 29
		"projectName" : "PasswordChecker"
		"version" : "123456"
	}
	
	2 : {
		"createdAt" : 1456039670845
		"createdBy" : "System"
		"name" : "URLChecker.ltz"
		"projectDescription" : " This monitor checks a URL by downloading its pages and embedded objects. Verification can be defined for title and content. "
		"id" : 6
		"projectName" : "URLChecker"
		"version" : "10.7.00"
	}
	 
	3 : {
		"createdAt" : 1456120000439
		"createdBy" : "dave"
		"name" : "PasswordChecker_Big_Timeout_with_attribute1.ltz"
		"projectDescription" : "Default Project"
		"id" : 37
		"projectName" : "PasswordChecker"
		"version" : "123456"
	}
	 
	4 : {
		"createdAt" : 1456039670392
		"createdBy" : "System"
		"name" : "Pop3Pinger.ltz"
		"projectDescription" : " This monitor connects to a POP3 server to check its availability. "
		"id" : 4
		"projectName" : "Pop3Pinger"
		"version" : "10.7.00"
	}
	
	5 : {
		"createdAt" : 1456039669501
		"createdBy" : "System"
		"name" : "FtpPinger.ltz"
		"projectDescription" : " This Monitor checks the availability of an FTP server by connecting to it and retrieving the current directory of the server. "
		"id" : 1
		"projectName" : "FtpPinger"
		"version" : "10.7.00"
	}
	 
	6 : {
		"createdAt" : 1456120019893
		"createdBy" : "dave"
		"name" : "PasswordChecker_Big_Timeout_with_attribute.ltz"
		"projectDescription" : "Default Project"
		"id" : 7
		"projectName" : "PasswordChecker"
		"version" : "39393939"
	}
	 
	7 : {
		"createdAt" : 1456039670282
		"createdBy" : "System"
		"name" : "Pinger.ltz"
		"projectDescription" : " This monitor checks the availability of a specified host by sending an ICMP echo request (ping). "
		"id" : 3
		"projectName" : "Pinger"
		"version" : "10.7.00"
	}
	 
	8 : {
		"createdAt" : 1456039670610
		"createdBy" : "System"
		"name" : "SmtpPinger.ltz"
		"projectDescription" : " This monitor connects to an SMTP server to check its availability "
		"id" : 5
		"projectName" : "SmtpPinger"
		"version" : "10.7.00"
	}
	 
	9 : {
		"createdAt" : 1456039670079
		"createdBy" : "System"
		"name" : "LdapPinger.ltz"
		"projectDescription" : " This monitor checks the availability of an LDAP server by connecting to it and exchanging authentication information between the client and server. "
		"id" : 2
		"projectName" : "LdapPinger"
		"version" : "10.7.00"
	}
	
}

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