Get Script Executions List
Gets the status of running or recently completed executions matching the specified filter parameters.
A maximum of 500 completed executions is available.
To use this operation, you must specify either time.offset, time.anchor, or both.
Request syntax
Syntax
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=value&time.anchor=value&time.offset=value[&optionalParameter=value]
Parameters
Name | Type | Default | Description |
---|---|---|---|
securityToken* | string |
|
A unique cryptographic key assigned to an authorized user. |
scriptKey | string |
|
The repository location of the script. For example, PUBLIC:deviceMonitoring.xml or PRIVATE:android\test.xml. |
admin | boolean | false | true to allow users with administrative credentials to get the status of executions started by other automation users. |
completed | boolean |
|
true to list completed executions. false to list running executions; If not specified, lists both running and completed executions. |
flowEndCode | string |
|
Success to list executions in which the scripts completed successfully. Failed to list executions in which the script encountered one or more function or validation failures. UserAborted to list executions in which the script was aborted by a user. If not specified, lists executions for all flowEndCode values. |
time.type | string | started | started to refers to the execution start time. completed to refers to the execution completion time. |
time.anchor | string | now | The point in time from which to compute the time period, in Unix time. The value is specified as the number of millisecond from midnight January 1, 1970 UTC to the desired anchor time. To specify the default time, now, set the time.anchor value to time.anchor=-1 |
time.offset | string |
|
The duration of the time period specified as the number of seconds from the anchor point. |
responseFormat | string | json | Format of response: xml, json. |
* Mandatory
Time Parameters
The time parameters allow you to filter the list of executions by specifying the time period within which the executions either started or completed. The computation of the time period uses the following rules:
- if time.anchor and time.offset are specified, the time period is from time.anchor for the duration of time.offset
- if only time.anchor is specified, the time period is from time.anchor to the current time
- if only time.offset is specified, time.offset is always treated as negative and therefore the time period is the last time.offset seconds
Response
Name | Description |
---|---|
executionId | The unique identifier that you can use to get the status of the running script or abort it. The identifier is only valid during, and for a short period after, the script's execution. |
devices | The information of the devices used in the script. Includes the id, manufacturer and model. |
reportKey |
The identifier that you can use to download the execution report from the repository. The key is only valid once the script's execution completes and does not expire. For example, PRIVATE:reportName.xml. |
completed | true if the execution had completed. |
user | The user account that started the execution. |
flowEndCode |
The completion code of the execution. The following is a list of the possible return values: |
parent | If the execution was invoked by another execution, this field contains the execution identifier of the parent execution. This field can be used to identify child executions, or to query the status of a parent execution. |
Examples
This section lists several usage examples.
Request a list of all executions that started within a specified time period
Request
//Last 30 Seconds
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.offset=30
//after the specified anchor time
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.anchor=1299396017483
//within 30 seconds after specified the anchor time
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.anchor=1299396017483&time.offset=30
//within 30 seconds before specified the anchor time
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.anchor=1299396017483&time.offset=-30
JSON response
{
"executions":[{
"executionId":"samb@perfectomobile.com_simpleTest_16-11-09_12_22_14_81",
"devices":[{
"model":"Galaxy S6",
"id":"0815F88CDFB51B05",
"manufacturer":"Samsung" }
],
"reportKey":"PRIVATE:161109/simpleTest_16-11-09_12_22_14_81.xml",
"completed":"true",
"user":"samb@perfectomobile.com",
"flowEndCode":"Success" },
{
"executionId":"samb@perfectomobile.com_simpleTest_16-11-09_12_22_14_98",
"devices":[{
"model":"iPhone-6 Plus",
"id":"51ADE02B41DC9182C624D6B9099D3055AFC3AB7D",
"manufacturer":"Apple" }
],
"reportKey":"PRIVATE:161109/simpleTest_16-11-09_12_22_14_98.xml",
"completed":"true",
"user":"samb@perfectomobile.com",
"flowEndCode":"Success" }
]
}
Request a list of all executions of a specified script that started within the last 30 seconds
Request
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.offset=30&scriptKey=PRIVATE:simpleTest.xml
Request a list of all executions that completed within a specified time period
Request
//last 30 seconds
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.offset=30&time.type=completed
//after the specified anchor time
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.anchor=1299396017483&time.type=completed
Request a list of all aborted executions that started within the last 30 seconds
Request
https://mycloud.perfectomobile.com/services/executions?operation=list&securityToken=<your_token>&time.offset=30&flowEndCode=UserAborted