Create Sauce Labs With TeamId

Description

The endpoint Create Sauce Labs With TeamId is used to create a Sauce Labs Agent under a specified team in Leapwork. After the successful creation of the Sauce Labs Agent, the Id of the Agent is returned in response.

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

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

Request URL

http://{controllerMachine}:{controllerPort}/api/v4/agents/create/teamid/saucelab

Input parameters

Property Type Description Comments
teamId string The teamId is a unique Id for the team defined under the LEAPWORK Enterprise Edition. teamId can be fetched from Response Body of Get All Team endpoint
requestBody application/json

Unique identifiers for the Sauce Labs Agent comprising the following parameters:

  • Title
  • Description
  • UserName
  • AccessKey
  • OSType
  • OSVersion
  • Browser
  • BrowserVersion
  • MobileDevice

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

 

Examples

Curl


curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' -d '{ \
"Title": "My Remote Agent", \
"Description": "Remote Agent", \
"UserName": "LeapworkUser", \
"AccessKey": "Password", \
"OSType": "Windows", \
"OSVersion": "10", \
"Browser": "Chrome", \
"BrowserVersion": "latest", \
"MobileDevice": "Android GoogleAPI Emulator"

}' 'http://{controllerMachine}:{controllerPort}/api/v4/agents/create/teamId/saucelab'

PowerShell 

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

$requestBody = @'
{
    "Title": "My Remote Agent ",
    "Description": "Remote Agent",
    "UserName": "LeapworkUser",
    "AccessKey": "Password",
   
"OSType": "Windows",
    "OSVersion": "10",
    "Browser": "Chrome",
    "BrowserVersion": "latest",
    "MobileDevice": "Android GoogleAPI Emulator"

}
'@ 

Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v4/agents/create/teamid/saucelab" -ContentType "application/json" -Headers $headers -Method PUT  -Body $requestBody

Response Body

CreateAgentResponse object:

{

  "$id": "1",

  "AgentId": "4d9c09fe-7ced-4494-8841-378491ebc899"

}

 

Response Object

Field Type Description Values
$id String ID of the internal item (Folder/ Flow/Element etc.)  
AgentId String ID of the Agent created  


Response Code

200 (OK)

404 (Not Found)

401 (Incorrect Access Key)

400 (Bad Request, asset not found)

500 (Internal Server Error)