Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning centerCreate Folder Hierarchy
'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.
Please note that hierarchy like “..folder1/folder2/” and “..folder1//folder2“ are not allowed.
http://{controllerMachine}:{controllerPort}//api/v3/hierarchy/create/folder/{itemId}
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' |
curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' 'http://{controllerMachine}:{controllerPort}/api/v3/hierarchy/create/folder/{itemId}'
$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
List of Variables
[ "$id": "1", "HierarchyItemId": "4fa4d1c3-cf08-40b3-861e-d88253458255" } |
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)
401 (Unauthorized, incorrect access key)
400 (Incorrect parameter 'folder' key or its value)
409 (API Returns 409 error, If ItemId cannot create folder or ItemId already contains folder item with the same title or ItemId already contains same hierarchy)
500 (Internal Server Error)
©2024, Leapwork. All rights reserved.