CreateDirectory - Create a test case folder

Updated at:

Applicable editions

Central edition, Region edition

Endpoints and authorization

  • Obtain an endpoint. Replace {domain} in the request syntax with the endpoint.
  • Obtain a personal access token.
  • Obtain an organization ID: Required only for the Central edition. Go to the organization management console and obtain the organization ID from the basic information page.

Product

Resource

Required permissions

Test management

Test case folder

Read and write

Request syntax

Central edition

POST https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepos/{id}/directories

Region edition

POST https://{domain}/oapi/v1/testhub/testRepos/{id}/directories

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

The personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

id

string

path

Yes

The ID of the test case repository.

organizationId

string

path

  • Yes (Central edition)

  • No (Region edition)

The organization ID.

-

object

body

No

name

string

body

Yes

The name of the folder.

Functional testing

parentIdentifier

string

body

No

The ID of the parent folder. If not specified, the folder is created in the root folder.

dir-id-xxx

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepos/{id}/directories' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "Functional testing",
        "parentIdentifier": "dir-id-xxx"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/testRepos/{id}/directories' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "name": "Functional testing",
        "parentIdentifier": "dir-id-xxx"
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

The ID of the folder.

testcase-directory-id-xxx

name

string

The name of the folder.

testcase-directory-name-xxx

parentId

string

The ID of the parent folder.

testcase-directory-parent-id-xxx

Response example

{
    "id": "testcase-directory-id-xxx",
    "name": "testcase-directory-name-xxx",
    "parentId": "testcase-directory-parent-id-xxx"
}

Error codes

For error codes, see the Error code center.