Knowledge base
Tips and tricks Best practice guides, FAQ & more
Find tutorials, guides and use case examples in the
Learning centerThe endpoint Update Browser Stack is used to update an Agent of BrowserStack type in Leapwork. After the successful update of a Browser Stack 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 Platform Edition only.
(PUT) http://{controllerMachine}:{controllerPort}/api/v4/agents/update/browserstack/{agentId}
Field |
Type |
Description |
accessKey |
string |
An access key is required to restrict unauthorized access to the API. |
agentId
|
string |
Unique id of agent |
requestBody |
application/json |
Unique identifiers for the BrowserStack Agent comprising the following parameters:
|
curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' -d '{ \
"IsWebLocal": true, \
"Title": "My Browser Stack Agent", \
"Description": "Browser Stack Agent", \
"UserName": "string", \
"AccessKey": "Password", \
"OSType": "Windows", \
"OSVersion": "10", \
"Browser": "Chrome", \
"BrowserVersion": "latest",\
"LocalIdentifier": "local", \
"ScreenResolution": { \
"Width": 0, \
"Height": 0 \
}, \
}' 'http://localhost:9001/api/v4/agents/update/browserstack/1a8d0f39-ce50-4a35-bed1-770b4de3f957'
$headers = @{}
$headers.Add("accessKey","Mo87Nc4qDAtzJNDb")
$requestBody = @'
{
"IsWebLocal": true,
"Title": "My Browser Stack Agent",
"Description": "Browser Stack Agent",
"UserName": "string",
"AccessKey": "Password",
"OSType": "Windows",
"OSVersion": "10",
"Browser": "Chrome",
"BrowserVersion": "latest",
"LocalIdentifier": "local",
"ScreenResolution": {
"Width": 0,
"Height": 0
},
}
'@
Invoke-WebRequest -Uri "http://localhost:9001/api/v4/agents/update/browserstack/1a8d0f39-ce50-4a35-bed1-770b4de3f957" -ContentType "application/json" -Headers $headers -Method PUT -Body $requestBody
Update agent and returns true for successful operation completion in the response.
{
"$id": "1",
"AgentId": "1a8d0f39-ce50-4a35-bed1-770b4de3f957",
"IsSuccessful": true
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)
400 (Bad Request – eg: “Invalid endpoint for Enterprise version")
401 (Unauthorized - eg: “Incorrect Accesskey”)
403 (Forbidden – eg: “AccessKey does not have the relevant scope permission”)
500 (Internal Server Error)
©2024, Leapwork. All rights reserved.