Book demo
Start trial
Book demo
Start trial

Create Folder Hierarchy 

Description

'Create Folder Hierarchy' endpoint is used to create folder(s) with specific hierarchical structure in LEAPWORK. To create folder hierarchy enter folder titles one after another separated by '/' symbol. After successful creation of folder endpoint returns HierarchyItemId which is the hierarchy item id in which the folder hierarchy is going to be created. 

The ItemId parameter is the item id of pre-existing Flow or Folder under which new Item need to be added. If itemId is null or empty, folder hierarchy will be created in the root folder.

Request URL

http://{controllerMachine}:{controllerPort}//api/v3/hierarchy/create/folder/{itemId}

Input parameters

Field Type Description Comments
itemId string Unique identifier for Items in the Asset hierarchy The itemId can be from the following types of items:
- 'Folder'
- 'Flow'
- 'SubFlow'

Examples

Curl

curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' 'http://{controllerMachine}:{controllerPort}/api/v3/hierarchy/create/folder/{itemId}'

PowerShell 

$headers = @{}
$headers.Add("AccessKey","123qwe")
Invoke-WebRequest -Uri "http://autobotvm001:9001/api/v3/hierarchy/create/folder?folder=Project1/Feature1" -ContentType "application/json" -Headers $headers -Method PUT 

Response Body

List of Variables

[
   {

     "$id": "1",

     "HierarchyItemId": "4fa4d1c3-cf08-40b3-861e-d88253458255"

    }
]

 

Response Object

Field Type Description Values
$id string ID of internal item(Folder/ Flow/Element etc.)  
HierarchyItemId string HierarchyItemId is Id of newly created Folder in the hierarchy.  


Response Code

200 (OK)

404 (Not Found)

401 (Unauthorized)

400 (Bad Request, If ItemId cannot create folder)

409 (If ItemId already contains non-folder item with the same title or If ItemId already contains hierarchy, equal to which one is going to be created)

405 (Method Not Allowed)

500 (Internal Server Error)