Help Center/ CodeArts PerfTest/ API Reference/ API/ Case Management/ Creating a Case (Old Edition)
Updated on 2024-04-08 GMT+08:00

Creating a Case (Old Edition)

Function

This API is used to create a case on the old UI.

URI

POST /v1/{project_id}/task-cases

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

Minimum: 0

Maximum: 64

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name.

Minimum: 1

Maximum: 42

type

Yes

Integer

Type (0: common case; 1: video stream case; 2: preset case).

Minimum: 0

Maximum: 2

task_id

Yes

Integer

Task ID.

Minimum: 0

Maximum: 2147483647

Response Parameters

Status code: 201

Table 3 Response body parameters

Parameter

Type

Description

code

String

Response code.

Minimum: 0

Maximum: 1024

json

CreateCaseResultJson object

json

message

String

Response message.

Minimum: 0

Maximum: 1024

Table 4 CreateCaseResultJson

Parameter

Type

Description

task_case_id

Integer

Case ID.

Minimum: 0

Maximum: 2147483647

Example Requests

Creating a case named case1. The ID of the task to which the case belongs is 1.

/v1/projectId/task-cases

{
  "name" : "case1",
  "type" : 0,
  "task_id" : 1
}

Example Responses

Status code: 201

success

{
  "code" : "SVCSTG.CPTS.0000000",
  "json" : {
    "task_case_id" : 213142
  },
  "message" : "success"
}

Status code: 501

unknown error

""

Status Codes

Status Code

Description

201

success

501

unknown error

Error Codes

See Error Codes.