CreateTestRepo - Create a test case library

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 library

Read and write

Request syntax

Central edition

POST https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepo

Region edition

POST https://{domain}/oapi/v1/testhub/testRepo

Request header

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

organizationId

string

path

  • Yes (Central edition)

  • No (Region edition)

The organization ID.

-

object

body

No

customCode

string

body

No

The code of the test case library. Optional. If not specified, a code is generated automatically.

TR-0001

description

string

body

No

The description. Optional.

This is a test case library

icon

string

body

No

The cover icon. Optional.

https://img.alicdn.com/imgextra/i4/O1CN013XKqUi1MLwhFirv1o_!!6000000001419-2-tps-96-96.png

name

string

body

Yes

The name of the test case library.

My test case library

scope

string

body

No

The visibility scope. Valid values: public, private. Default: public.

public

Request examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepo' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "customCode": "TR-0001",
        "description": "This is a test case library",
        "icon": "https://img.alicdn.com/imgextra/i4/O1CN013XKqUi1MLwhFirv1o_!!6000000001419-2-tps-96-96.png",
        "name": "My test case library",
        "scope": "public"
    }'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/testhub/testRepo' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "customCode": "TR-0001",
        "description": "This is a test case library",
        "icon": "https://img.alicdn.com/imgextra/i4/O1CN013XKqUi1MLwhFirv1o_!!6000000001419-2-tps-96-96.png",
        "name": "My test case library",
        "scope": "public"
    }'

Response parameters

Parameter

Type

Description

Example value

-

object

id

string

The ID.

id-xxx

Response example

{
    "id": "id-xxx"
}

Error codes

For error codes, see the Error Code Center.