Creates a new folder for items of the specified entity type in QAComplete.
Use the operation to create a new folder for items of the specified entity type in the specified project in QAComplete.
To update all the fields of the folder, use the …/{EntityCode}/folders/{id} (PUT) operation. To update specific fields of a folder, use the …/{EntityCode}/folders/{id} (PATCH) operation.
Authentication
Basic authentication using a user’s login and password. See Authentication for details.
Security Rights
The authenticating user must belong to a security group that has the Add privilege for the specified entity type.
Request Format
To create a folder, send a POST request to the following URL:
URL parameters
ProjectId : integer, required
The ID of the project, to which you want to add a folder.
EntityCode : string, required
The entity to add the folder to. Possible values:
- Releases
- Bugs (defects)
- FunctionalSpecs (requirements)
- Tests
- TestSets
- TestSteps
Body parameters
In the request body, pass the RequestFolderPost
object that describes the folder to be created.
{
"FolderName": "string",
"Description": "string",
"IsPublic": "boolean",
"ParentName": "string",
"IsActive": "boolean"
}
FolderName : string, required
The folder’s name.
Description : string
The short description of the folder.
IsPublic : boolean
Defines whether the folder is public or private. Default value: true
.
ParentName : string
The parent folder’s name.
IsActive : boolean
Defines whether the folder is active or hidden. Default value: false
.
A sample request:
POST http://yourserver.com/rest-api/service/api/v2/projects/11873/FunctionalSpecs/folders HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 158
{
"FolderName": "Sample Folder",
"Description": "My first sample folder.",
"IsPublic": true,
"IsActive": true
}
A sample request made by using cURL:
curl -u [email protected]:p@ssword -d @folder.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v2/projects/11873/FunctionalSpecs/folders
Response Format
If successful, the operation responds with HTTP status code 200. The response is a JSON object with information on the added folder.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 528
{
"id": 254,
"parent_id": 0,
"project_id": 11873,
"entity_code": "Requirements",
"folder_name": "Sample Folder",
"is_active": true,
"description: "My first sample folder."
"is_public": true,
"date_created": "2013-09-14T13:53:53.4230000",
"date_updated": "2013-09-14T13:53:53.4230000",
"update_user_id": 24663,
"owner_user_id": 24663,
"full_folder_name": "Sample Folder",
"updated_user_name": "Smith, John",
"created_user_name": "Smith, John"
}
The project’s unique identifier.
The folder’s unique identifier.
The code of the entity the folder belongs to.
The ID of the last user who updated the folder.
The ID of the user who owns the folder.
The date and time when the folder was created.
The date and time when the folder was last updated.
True if the folder is active and False if hidden.
True if the folder is public and False if private.
The name of the last user, who updated the folder, in the Lastname, Firstname format.
The name of the user, who created the folder, in the Lastname, Firstname format.
The ID of the folder in which the selected folder resides.
The parent folder’s name.
The folder’s name.
The folder’s short description.
The full path to the folder.
Error responses
If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
If the project with the specified ProjectId does not exist or the authenticating user does not have rights to access the project, the operation returns the Access is denied
error.
If the specified entity does not exist, the operation returns the 'Invalid entity code' error.