Update LambdaTest with TeamId

Description

The endpoint Update Remote Agent with TeamId is used to update an Agent of Remote Agent type in Leapwork, based on a specific team. After the successful update of a Remote Agent, the agent Id is returned in the response.

The details of the updated agent can be validated with the help of the Get Agent by Id endpoint.

Please note this endpoint will work with the Leapwork Enterprise Edition only. 

Request URL

(PUT) http://{controllerMachine}:{controllerPort}/api/v4/agents/update/{teamId}/remoteagent/{agentId}

Input parameters

Field

Type

Description

Comment

accessKey

string

An access key is required to restrict unauthorized access to the API.

The Access Key should include an agent scope to access the API.

agentId

 

 

string

Unique id of agent

 

teamId

string

Unique id of team

 

requestBody

application/json

Unique identifiers for the Remote Agent comprising the following parameters:

·       Port

·       Title

·       Description

·       HostName

·       Password

·       AuthenticationType

·       Password

·       WindowsLogin

·       WindowsPassword

·       LockSessionAfterDisconnect

·       ScreenResolution

·       SapLogonMode

·       TerminalApplication

 

Kindly refer to the documentation for Agents for more details on the usage.

Examples

Curl

curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' -d '{ \

"Port": "6777", \

"Title": "My Remote Agent Environment", \

"Description": "Remote Agent", \

"HostName": "192.168.1.100", \

"AuthenticationType": "windowsLogin",\

"Password": "string",\

"WindowsLogin": "string",\

"WindowsPassword": "string",\

"LockSessionAfterDisconnect": true,\

"ScreenResolution": { \

     "Width": 0, \

     "Height": 0 \

   }, \

   "SapLogonMode": "sAPLogonPAD", \

   "TerminalApplication": "iBMiAccessClientSolutions_x32" \

}' 'http://localhost:9001/api/v4/agents/update/2226f0c6-71a8-46fd-8f76-9a4d6d87d864/remoteagent/1a8d0f39-ce50-4a35-bed1-770b4de3f957'

PowerShell 

$headers = @{}
$headers.Add("accessKey","Mo87Nc4qDAtzJNDb")

$requestBody = @'

{

   "Port": "6777",

   "Title": "My Remote Agent",

   "Description": "Remote Agent",

   "HostName": "192.168.1.100",

   "AuthenticationType": "windowsLogin",

   "Password": "string",

   "WindowsLogin": "string",

   "WindowsPassword": "string",

   "LockSessionAfterDisconnect": true,

   "ScreenResolution": {

     "Width": 0,

     "Height": 0

    },

   "SapLogonMode": "sAPLogonPAD",

   "TerminalApplication": "iBMiAccessClientSolutions_x32"

 

}

'@

Invoke-WebRequest -Uri "http://localhost:9001/api/v4/agents/update/2226f0c6-71a8-46fd-8f76-9a4d6d87d864/remoteagent/1a8d0f39-ce50-4a35-bed1-770b4de3f957" -ContentType "application/json" -Headers $headers -Method PUT -Body $requestBody

Response

Update agent and returns true for successful operation completion in the response.

{

"$id": "1",

"AgentId": "1a8d0f39-ce50-4a35-bed1-770b4de3f957",

"IsSuccessful": true

}

Response object

Field

Type

Description

Values

$id

string

ID of internal object

 

AgentId

string

ID of the Agent updated

 

IsSuccessful

bool

Returns ‘true’ for successful operation

true| false

Response Code

200 (OK)

401 (Unauthorized - eg: “Incorrect Accesskey”)

403 (Forbidden – eg: “AccessKey does not have the relevant scope permission”)

404 (Not Found – eg: “Asset not found")

500 (Internal Server Error)