Get Variable by Name

Description

Returns details of a specific permanent variable identified by the variable name.

Request URL

http://{controllerMachine}:{controllerPort}/api/v4/variables/MyVariable

Input parameters

Field Type Description Comment
name string Name of the variable. Variable name is case sensitive

Examples

Curl

 curl -X GET --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' 'http://localhost:9001/api/v4/variables/MyVariable'

PowerShell 

$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")
Invoke-WebRequest -Uri "http://localhost:9001/api/v4/variables/MyVariable" -ContentType "application/json" -Headers $headers -Method GET

Response Body

Information about the variable name and its value:

{
{
"$id": "1",
"Name": "Var2",
"Value":
{
"$id": "2",
"$type": "Leapwork.Models.Models.LDataTypes.LText, Leapwork.Models",
"Value": "500"
}
}
}

 

Response Parameters

Field Type Description Values
$id string ID of internal object  
Name string Name of the variable  
Value LSignal Object holds values for Variable "$id", "$type", "Value"
LSignal Object    
$id string ID of internal object  
Type Leapwork.Models.Models.LDataTypes.Ltext Static data type  
Value string Value of the variable  


Response Code

200 (OK)

401 (Unauthorized,incorrect access key)

404 (Variable not found)

500 (Internal Server Error)