Get All Modules Under Root Or A Specific Module
Update A Module Or Move It To Other Container
Get A Module By Its ID
GET /api/v3/projects/{projectId}/modules/{moduleId}
qTest version: 6+
Description: To retrieve a module's details using its ID.
Path variable:
- projectId: ID of the project
- moduleId: ID of the module which you want to retrieve
Request Parameter:
Parameter | Required | Description |
expand | no | If you specify expand=descendants, the response will include all of its children and grand children modules. |
Request sample:
GET /api/v3/projects/5714/modules/298049?expand=descendants HTTP/1.1 Host: linhdang.qtestnet.com Authorization: bearer [token] Cache-Control: no-cache
Response sample:
{ "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298049, "name": "Manage Contacts", "order": 2, "pid": "MD-66", "parent_id": 298039, "description": "This module contains all requirements/test cases regarding the features Create/Edit/Delete contacts on qConnect.", "children": [ { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298050" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298050, "name": "Create a Contact", "order": 11, "pid": "MD-67", "parent_id": 298049, "description": "Create a Contact", "children": [ { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/1099276" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298050" } ], "id": 1099276, "name": "Grand Children Module", "order": 265333, "pid": "MD-149", "parent_id": 298050, "description": "" } ] }, { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298053" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298053, "name": "Delete a Contact", "order": 12, "pid": "MD-70", "parent_id": 298049, "description": "Delete a Contact" }, { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298052" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298052, "name": "Edit a Contact", "order": 13, "pid": "MD-69", "parent_id": 298049, "description": "Edit a Contact" }, { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298051" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298051, "name": "View a Contact", "order": 14, "pid": "MD-68", "parent_id": 298049, "description": "View a Contact" } ] }
Get All Modules Under Root Or A Specific Module
GET /api/v3/projects/{projectId}/modules
qTest version: 6+
Description: If you specify ID of a Module in the request parameter, the response will include its sub modules. If not, all modules under root are returned.
Path variable:
- projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
parentId | no | Specify ID of the parent module to retrieve its sub modules. |
expand | no | If you specify expand=descendants, it will recursively return all modules under root or the specified parent module. |
Request sample:
GET /api/v3/projects/5714/modules?parentId=298049&expand=descendants HTTP/1.1 Host: linhdang.qtestnet.com Authorization: bearer [token] Cache-Control: no-cache
Response sample:
[ { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298050" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298050, "name": "Create a Contact", "order": 11, "pid": "MD-67", "parent_id": 298049, "description": "Create a Contact", "children": [ { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/1099276" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298050" } ], "id": 1099276, "name": "Grand Children Module", "order": 265333, "pid": "MD-149", "parent_id": 298050, "description": "" } ] }, { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298051" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298051, "name": "View a Contact", "order": 14, "pid": "MD-68", "parent_id": 298049, "description": "View a Contact" }, { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298052" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298052, "name": "Edit a Contact", "order": 13, "pid": "MD-69", "parent_id": 298049, "description": "Edit a Contact" }, { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298053" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298053, "name": "Delete a Contact", "order": 12, "pid": "MD-70", "parent_id": 298049, "description": "Delete a Contact" } ]
Search For Modules By Name
GET /api/v3/projects/{projectId}/modules?search={keyword}
qTest version: 6+
Description: To search for Modules by their name. You need to input a free-text. The response will include all Test Cases whose names contain the specified free-text.
Path variable:
- projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
search | yes | The free-text to search for Modules by names. |
parentId | No | If ID of a parent Module is specified, the system will only search for sub-modules under this parent Module. If not, the response will include the modules located directly under root. |
expand | No | If you set expand=descendants, the response will include the modules that meet the search criterion and their parent and grand parent modules |
Request sample:
GET /api/v3/projects/5714/modules?search=edit&expand=descendants&parentId=298049 HTTP/1.1 Host: linhdang.qtestnet.com Authorization: bearer [token] Cache-Control: no-cache
Response sample:
[ { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298039" } ], "id": 298049, "name": "Manage Contacts", "order": 2, "pid": "MD-66", "parent_id": 298039, "description": "This module contains all requirements/test cases regarding the features Create/Edit/Delete contacts on qConnect.", "children": [ { "links": [ { "rel": "self", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298052" }, { "rel": "module", "href": "https://linhdang.qtestnet.com/api/v3/projects/5714/modules/298049" } ], "id": 298052, "name": "Edit a Contact", "order": 13, "pid": "MD-69", "parent_id": 298049, "description": "Edit a Contact" } ] } ]
Create A Module
POST /api/v3/projects/{projectId}/modules/
qTest version: 4+
Description: To create a new module. You can optionally specify a parent Module in the request parameter.
Path variable:
- projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
parentId | no | The parent module which will contain the newly created one. If it is not specified, the newly created module is located under root. Use this parameter if your qTest version is 6+. For older versions, specify parent_id in the request body. |
Request body:
Attribute Name | Required | Type | Description |
---|---|---|---|
name | True | String | Module name |
shared | False | Boolean | Only use this attribute if Test Case Sharing feature is enabled in the project. Specify if the Module is shared to other projects. |
description | False | String | Module description |
Request sample:
POST /test-conductor/api/v3/projects/4/modules?parentId=24 HTTP/1.1 Host: localhost:8080 Content-Type: application/json Authorization: bearer [token] Cache-Control: no-cache { "name": "CREATE module in module", "description": "" }
Response sample:
{ "links": [ { "rel": "self", "href": "http://localhost:8080/test-conductor/api/v3/projects/4/modules/68" } ], "id": 68, "name": "CREATE module in module", "order": 13, "pid": "MD-34", "parent_id": 24, "description": "" }
Update A Module Or Move It To Other Container
PUT /api/v3/projects/{projectId}/modules/{moduleId}
qTest version: 6+
Description: To update properties of an existing module or to move it to other parent module.
Path variable:
- projectId: ID of the project
- moduleId: ID of the module which needs to be updated
Request Parameter: use this parameter in case you want to move the test run to other container.
Important: If you use the request parameters, the request body will be ignore. That means the module is being moved but it will not be updated with the properties specified in the request body.
Parameter | Required | Description |
parentId | no | Specify the parent module which it will be moved to |
Request body:
Attribute Name | Required | Type | Description |
---|---|---|---|
name | True | String | Module name |
shared | False | Boolean | Only use this attribute if Test Case Sharing feature is enabled in the project. Specify if the Module is shared to other projects. |
description | False | String | Module description |
Request sample:
PUT /test-conductor/api/v3/projects/4/modules/24 HTTP/1.1 Host: localhost:8080 Content-Type: application/json Authorization: bearer [token] Cache-Control: no-cache { "name": "UPDATE module", "description": "UPDATE module" }
Response sample:
{ "links": [ { "rel": "self", "href": "http://localhost:8080/test-conductor/api/v3/projects/4/modules/25" }, { "rel": "module", "href": "http://localhost:8080/test-conductorapi/v3/projects/4/modules/27" } ], "id": 25, "name": "Move to root", "order": 1, "pid": "MD-3", "parent_id": 27, "description": "Move to root" }
Delete A Module
DELETE /api/v3/projects/{projectId}/modules/{moduleId}
qTest version: 6+
Description: To delete an existing module.
Path variable:
- projectId: ID of the project
- moduleId: ID of the module which needs to be deleted
Request Parameter:
Parameter | Required | Description |
force | no | force=true - delete the module and its children. force=false - only delete the module if it contains no sub modules or test cases. This is the default value. |