适用版本 | 中心版、Region版 |
服务接入点与授权信息
产品 | 资源 | 所需权限 |
测试管理 | 测试用例库 | 读写 |
请求语法
中心版
POST https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepoRegion版
POST https://{domain}/oapi/v1/testhub/testRepo请求头
参数 | 类型 | 是否必填 | 描述 | 示例值 |
x-yunxiao-token | string | 是 | 个人访问令牌。 | pt-0fh3****0fbG_35af****0484 |
请求参数
参数 | 类型 | 位置 | 是否必填 | 描述 | 示例值 |
organizationId | string | path |
| organizationId。 | |
| - | object | body | 否 | ||
customCode | string | body | 否 | 用例库编号,可选;不传时自动生成。 | TR-0001 |
description | string | body | 否 | 描述,可选。 | 这是一个用例库 |
icon | string | body | 否 | 封面图标,可选。 | https://img.alicdn.com/imgextra/i4/O1CN013XKqUi1MLwhFirv1o_!!6000000001419-2-tps-96-96.png |
name | string | body | 是 | 用例库名称。 | 我的用例库 |
scope | string | body | 否 | 可见范围,public / private,默认 public,可能的值:[public private]。 | public |
请求示例
中心版
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": "这是一个用例库",
"icon": "https://img.alicdn.com/imgextra/i4/O1CN013XKqUi1MLwhFirv1o_!!6000000001419-2-tps-96-96.png",
"name": "我的用例库",
"scope": "public"
}'Region版
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": "这是一个用例库",
"icon": "https://img.alicdn.com/imgextra/i4/O1CN013XKqUi1MLwhFirv1o_!!6000000001419-2-tps-96-96.png",
"name": "我的用例库",
"scope": "public"
}'返回参数
参数 | 类型 | 描述 | 示例值 |
| - | object | ||
id | string | id。 | id-xxx |
返回示例
{
"id": "id-xxx"
}错误码
访问错误码中心查看 API 相关错误码。
该文章对您有帮助吗?