Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning centerEdit Variable by Name
Updates the value of a permanent variable identified by the variable name.
http://{controllerMachine}:{controllerPort}/api/v4/variables
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' -d '{ \
"$id": "1", \
"Name": "MyVariable", \
"Value": { \
"$id": "2", \
"$type": "Leapwork.Models.Models.LDataTypes.LText, Leapwork.Models", \
"Value": "New Value" \
} \
}' 'http://{controllerMachine}:{controllerPort}/api/v4/variables'
$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")
$requestBody = @'
{
"$id": "1",
"Name": "MyVariable",
"Value":
{
"$id": "2",
"$type": "Leapwork.Models.Models.LDataTypes.LText, Leapwork.Models",
"Value": "New Value"
}
}
'@
Invoke-WebRequest -Uri "http://localhost:9001/api/v4/variables" -ContentType "application/json" -Headers $headers -Method PUT -Body $requestBody
Modified value of a variable.
{ |
Property | Type | Description | Values |
---|---|---|---|
$id | string | ID of internal object | |
Name | string | Name of the variable | |
Value | LSignal | Object holds values for a 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 in variable |
Response Code
200 (OK)
401 (Unauthorized,incorrect access key)
404 (Variable not found)
500 (Internal Server Error)
©2024, Leapwork. All rights reserved.