文档首页/ 测试计划 CodeArts TestPlan/ API参考/ API/ 接口测试管理/ 导入collection文件生成测试步骤 - CreateTestStepByCollection
更新时间:2025-12-27 GMT+08:00
分享

导入collection文件生成测试步骤 - CreateTestStepByCollection

功能介绍

上传postman的collection文件

调用方法

请参见如何调用API

URI

POST /v1/{project_id}/postman-collection

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释:

项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID

约束限制:

不涉及

取值范围:

项目uuid应符合如下规则:长度等于32位,包含大小写字母、数字

默认取值:

不涉及

表2 Query参数

参数

是否必选

参数类型

描述

branch_uri

String

分支唯一标识

tmss_case_uri

String

测试管理用例uri

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制:

必传。

取值范围:

字符串长度不少于1,不超过10万。

默认取值:

不涉及。

表4 FormData参数

参数

是否必选

参数类型

描述

req

File

要上传的文件流

响应参数

状态码:200

表5 响应Body参数

参数

参数类型

描述

error

CommonResponseErrorOfobject object

统一错误返回

reason

String

错误原因

result

Object

结果

status

String

'状态值,如success、error'

  • success,请求成功

  • error,请求报错

表6 CommonResponseErrorOfobject

参数

参数类型

描述

code

String

错误码

reason

String

错误原因

状态码:401

表7 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

状态码:403

表8 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

状态码:404

表9 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

状态码:500

表10 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

请求示例

post https://{endpoint}/v1/5a20b8323f3548008bd6e5669567538f/postman-collection?branch_uri=v91j0000vljf6i3s&tmss_case_uri=v91k0000vm823f04

响应示例

状态码:200

SUCCESS

{
  "status" : "success",
  "result" : [ {
    "id" : "1780286802764e67bcb581f498ff21f0",
    "projectId" : "925bb3aa54e145569f39e1d1b0fac371",
    "changeSign" : 0,
    "region" : "{region}",
    "relation" : null,
    "children" : null,
    "scriptName" : "https://100.93.1.72:8443/goserver/reflect\n",
    "create_time_string" : "2025-06-16 19:17:38 GMT+08:00",
    "update_time_string" : "2025-06-16 19:17:38 GMT+08:00",
    "create_time_stamp" : 1750072658000,
    "update_time_stamp" : 1750072658000,
    "create_user" : "CloudTest-0704",
    "create_time" : "2025-06-16T07:17:38+0800",
    "update_user" : "CloudTest-0704",
    "update_time" : "2025-06-16T07:17:38+0800",
    "name" : "https://100.93.1.72:8443/goserver/reflect\n",
    "condition_type" : null,
    "condition_statement" : null,
    "body_param_type" : "text",
    "aw_type" : 1,
    "aw_id" : "",
    "basic_aw" : {
      "id" : "",
      "warningMsg" : null,
      "name" : "https://100.93.1.72:8443/goserver/reflect\n",
      "source" : null,
      "method" : "https://100.93.1.72:8443/goserver/reflect\n",
      "description" : "https://100.93.1.72:8443/goserver/reflect\n",
      "nameView" : null,
      "tmssCaseNumber" : null,
      "region" : null,
      "yamlName" : null,
      "create_time_string" : "2025-06-16 19:17:38 GMT+08:00",
      "update_time_string" : "2025-06-16 19:17:38 GMT+08:00",
      "create_time_stamp" : 1750072658000,
      "update_time_stamp" : 1750072658000,
      "create_user" : "CloudTest-0704",
      "create_time" : "2025-06-16T07:17:38+0800",
      "update_user" : "CloudTest-0704",
      "update_time" : "2025-06-16T07:17:38+0800",
      "param_type_and_dft_value" : [ {
        "type" : "String",
        "name" : "body",
        "required" : false,
        "disabled" : false,
        "description" : null,
        "mock" : null,
        "isChecked" : null,
        "is_big_field" : null,
        "value_type" : 0,
        "basic_value" : {
          "value" : "{\r\n    \"result\": {\r\n        \"code\": 200,\r\n        \"status\": \"success\",\r\n        \"message\": [\r\n            {\r\n                \"key1\": \"value1\"\r\n            },\r\n            {\r\n                \"key2\": \"value2\"\r\n            },\r\n            {\r\n                \"key3\": \"value3\"\r\n            },\r\n            {\r\n                \"key4\": \"value4\"\r\n            },\r\n            {\r\n                \"key5\": \"value5\"\r\n            }\r\n        ]\r\n    }\r\n}",
          "value_range" : null
        },
        "enum_type" : null,
        "enum_type_selected" : null,
        "minLength" : null,
        "maxLength" : null,
        "minimum" : null,
        "maximum" : null,
        "format" : null,
        "pattern" : null,
        "xChoiceValue" : null,
        "maxItems" : null,
        "minItems" : null,
        "validate_rule" : null,
        "defaultValue" : null,
        "drop_down_value" : null,
        "in_type" : 2,
        "is_body_custom" : null,
        "custom_body" : null,
        "basic_value_list" : null,
        "object_value" : null,
        "object_value_list" : null,
        "is_contract_param" : null,
        "item" : null,
        "is_sensitive" : null
      } ],
      "dft_custom_header" : null,
      "dft_check_point_list" : null,
      "dft_variable_list" : null,
      "keyword_variable_value" : null,
      "dft_retry_times" : null,
      "dft_retry_interval" : null,
      "return_type" : null,
      "aw_type" : 1,
      "aw_ins_list" : null,
      "project_id" : "925bb3aa54e145569f39e1d1b0fac371",
      "public_aw_lib_id" : null,
      "special_type" : 99,
      "has_code" : null,
      "aw_code" : null,
      "group_name" : null,
      "protocol_type" : "http/https",
      "by_order" : null,
      "aw_mark" : 1,
      "output_param_list" : null,
      "is_favorite" : null,
      "tmss_case_id" : null,
      "create_user_id" : "fdc93bccd8d040778701d4d35a4a4313",
      "aw_description" : null,
      "origin_project" : null,
      "aw_uniqueid" : null,
      "aw_tags" : null,
      "aw_operationid" : null,
      "interface_label" : null,
      "import_package" : null,
      "public_aw_lib" : null,
      "root_id" : null,
      "custom_aw_libs" : null,
      "delete_time" : null,
      "delete_user" : null,
      "extra_info" : {
        "http_url" : "https://100.93.1.72:8443/goserver/reflect",
        "http_method" : "POST"
      }
    },
    "param_type_and_value" : [ {
      "type" : "String",
      "name" : "body",
      "required" : false,
      "disabled" : false,
      "description" : null,
      "mock" : null,
      "isChecked" : null,
      "is_big_field" : null,
      "value_type" : 0,
      "basic_value" : {
        "value" : "{\r\n    \"result\": {\r\n        \"code\": 200,\r\n        \"status\": \"success\",\r\n        \"message\": [\r\n            {\r\n                \"key1\": \"value1\"\r\n            },\r\n            {\r\n                \"key2\": \"value2\"\r\n            },\r\n            {\r\n                \"key3\": \"value3\"\r\n            },\r\n            {\r\n                \"key4\": \"value4\"\r\n            },\r\n            {\r\n                \"key5\": \"value5\"\r\n            }\r\n        ]\r\n    }\r\n}",
        "value_range" : null
      },
      "enum_type" : null,
      "enum_type_selected" : null,
      "minLength" : null,
      "maxLength" : null,
      "minimum" : null,
      "maximum" : null,
      "format" : null,
      "pattern" : null,
      "xChoiceValue" : null,
      "maxItems" : null,
      "minItems" : null,
      "validate_rule" : null,
      "defaultValue" : null,
      "drop_down_value" : null,
      "in_type" : 2,
      "is_body_custom" : null,
      "custom_body" : null,
      "basic_value_list" : null,
      "object_value" : null,
      "object_value_list" : null,
      "is_contract_param" : null,
      "item" : null,
      "is_sensitive" : null
    } ],
    "check_point_list" : [ ],
    "variable_list" : [ ],
    "retry_times" : "0",
    "retry_interval" : "0",
    "by_order" : 0,
    "from_outside" : null,
    "service_and_stage" : null,
    "is_contract_aw" : null,
    "is_sectest_aw" : null,
    "is_disabled" : null,
    "param_dependent" : null,
    "param_dependent_enabled" : null,
    "relation_id" : null,
    "relation_type" : 0,
    "extra_info" : {
      "summary" : null,
      "outputParam" : null,
      "importPackage" : null,
      "childImportPackage" : null,
      "mock" : null,
      "http_method" : "POST",
      "http_url" : "https://100.93.1.72:8443/goserver/reflect",
      "document_link" : null,
      "param_dependent" : null
    },
    "custom_header" : [ ],
    "level" : null,
    "hasLevel" : null,
    "is_basic" : 0,
    "his_script" : null,
    "description" : "https://100.93.1.72:8443/goserver/reflect\n",
    "aw_description" : null,
    "user_id" : null,
    "special_type" : 0,
    "error_info" : null,
    "alias_runaw" : null,
    "authentication_type" : null,
    "authentication_info" : null,
    "testmate_type" : null,
    "output_alias_info" : null,
    "header_array" : null
  } ],
  "reason" : null,
  "error" : null
}

状态码

状态码

描述

200

SUCCESS

401

Unauthorized

403

Forbidden

404

Not Found

500

ERROR

错误码

请参见错误码

相关文档