调用ListDataServicePublishedApis获取数据服务API的发布态信息列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| PageNumber |
integer |
否 |
页码,从 1 开始,默认值为 1。 |
1 |
| PageSize |
integer |
否 |
每页显示的条数,默认为 10 条,最大 50 条。 |
10 |
| ProjectId |
integer |
是 |
工作空间的 ID。 示例值仅用于展示格式;有效值可通过 ListProjects 响应中的 PageResult.ProjectList[].ProjectId 获取。调用前需开通 DataWorks 企业版或旗舰版,未开通时会返回 403 Forbidden.Access。 |
10000 |
| TenantId |
integer |
否 |
租户 ID。您可登录 DataWorks 控制台,进入数据开发(DataStudio)页面,单击右上方当前登录用户名称,选择菜单 > 用户信息,获取租户 ID。 |
10001 |
| ApiNameKeyword |
string |
否 |
API 名称的关键词,过滤得到 API 名称包含该关键词的 API。 |
My API name |
| ApiPathKeyword |
string |
否 |
API 路径的关键词,过滤得到 API 路径包含该关键词的 API。 |
/test/ |
| CreatorId |
string |
否 |
API 创建者的阿里云 ID,过滤得到该用户创建的 API。 |
12345 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| RequestId |
string |
请求 ID,一次请求的唯一标识。 |
0000-ABCD-EFG**** |
| ErrorMessage |
string |
错误信息。 |
The connection does not exist. |
| Success |
boolean |
调用是否成功。 |
true |
| ErrorCode |
string |
错误码。 |
Invalid.Tenant.ConnectionNotExists |
| Data |
object |
API 发布态信息返回。 |
|
| PageNumber |
integer |
页码,和请求中的 PageNumber 一致。 |
1 |
| PageSize |
integer |
每页显示的条数,默认为 10 条,最大 100 条。 |
10 |
| TotalCount |
integer |
总记录数。 |
100 |
| Apis |
array<object> |
API 发布态信息列表。 |
|
|
array<object> |
|||
| Timeout |
integer |
超时时间,单位毫秒 ms |
10000 |
| Status |
integer |
API 的状态,可选枚举值包括 0(未发布)和 1(已发布)。 |
1 |
| ApiId |
integer |
API 的 ID。 |
10002 |
| ApiMode |
integer |
API 的类型,可选枚举值包括 0(向导 API)、1(脚本 API)和 2(注册 API)。 |
0 |
| ProjectId |
integer |
工作空间的 ID。 |
10000 |
| ResponseContentType |
integer |
API 的返回数据类型,可选枚举值包括 0(JSON)和 1(XML)。向导和脚本 API 支持 JSON,注册 API 支持 JSON 和 XML。 |
0 |
| CreatorId |
string |
创建人的阿里云 ID。 |
1234567 |
| VisibleRange |
integer |
可见范围,可选枚举值包括 0(工作空间)和 1(私有)。 |
0 |
| ModifiedTime |
string |
最新修改时间。 格式示例为 |
2020-06-23T00:21:01+0800 |
| OperatorId |
string |
最新编辑人阿里云 ID |
2345678 |
| GroupId |
string |
分组 ID。 |
ab123 |
| Description |
string |
描述信息。 |
Test API description |
| RequestMethod |
integer |
API 的请求方式,可选枚举值包括 0(GET)、1(POST)、2(PUT)和 3(DELTE)。向导和脚本 API 支持 GET 和 POST。注册 API 支持 GET、POST、PUT 和 DELETE。 |
0 |
| CreatedTime |
string |
创建时间。 格式示例为 |
2020-06-23T00:21:01+0800 |
| ApiName |
string |
API 的名称。 |
My API name |
| TenantId |
integer |
租户 ID。 |
10001 |
| ApiPath |
string |
API 的路径。 |
/test/1 |
| Protocols |
array |
API 协议,可选枚举值包括 0(HTTP)和 1(HTTPS)。 |
|
|
integer |
API 协议,可选枚举值包括 0(HTTP)和 1(HTTPS)。 |
0 |
|
| RegistrationDetails |
object |
注册 API 详情,只有注册 API 返回。 |
|
| ServiceHost |
string |
后端服务地址。 |
http://www.abc.com |
| ServiceContentType |
integer |
API 的返回数据类型,可选枚举值包括 0(JSON)和 1(XML)。向导和脚本 API 支持 JSON,注册 API 支持 JSON 和 XML。 |
0 |
| ServicePath |
string |
后端服务路径。 |
/index |
| SuccessfulResultSample |
string |
正常返回示例。 |
{"success": true} |
| FailedResultSample |
string |
错误返回示例。 |
{"success": false} |
| ServiceRequestBodyDescription |
string |
后端请求 body 内容的描述。 |
{"abc":1} |
| RegistrationErrorCodes |
array<object> |
注册 API 的错误码列表。 |
|
|
object |
注册 API 的错误码列表。 |
||
| ErrorMessage |
string |
错误信息 |
fail to call |
| ErrorCode |
string |
错误码 |
1001 |
| ErrorSolution |
string |
错误解决方案 |
retry |
| RegistrationRequestParameters |
array<object> |
注册 API 的请求参数列表。 |
|
|
object |
|||
| ParameterName |
string |
参数名称 |
name1 |
| ParameterPosition |
integer |
参数位置,可选枚举值有:
向导和脚本 API,只支持 Query;注册 API,GET、DELETE 方法支持 Query、Head,PUT、POST 方法支持 Query、Head、Body。 |
0 |
| ParameterDescription |
string |
描述 |
description1 |
| DefaultValue |
string |
默认值 |
default1 |
| ParameterOperator |
integer |
运算符,可选枚举值有:
向导 API 支持 Equal、Like、In;脚本 API 支持 Equal;注册 API 支持 Equal、Const。 |
0 |
| ExampleValue |
string |
示例值 |
example1 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| IsRequiredParameter |
boolean |
是否必填 |
true |
| ScriptDetails |
object |
脚本 API 详情,只有脚本 API 返回。 |
|
| IsPagedResponse |
boolean |
返回是否分页 |
true |
| SuccessfulResultSample |
string |
正常返回示例 |
{"success": true} |
| FailedResultSample |
string |
错误返回示例 |
{"success": false} |
| Script |
string |
SQL 脚本 |
select a from t |
| ScriptErrorCodes |
array<object> |
脚本 API 错误码列表 |
|
|
object |
|||
| ErrorMessage |
string |
错误信息 |
fail to call |
| ErrorCode |
string |
错误码 |
1001 |
| ErrorSolution |
string |
错误解决方案 |
retry |
| ScriptRequestParameters |
array<object> |
脚本 API 请求参数列表 |
|
|
object |
|||
| ParameterName |
string |
参数名称 |
param1 |
| ParameterPosition |
integer |
参数位置,可选枚举值有:
向导和脚本 API,只支持 Query;注册 API,GET、DELETE 方法支持 Query、Head,PUT、POST 方法支持 Query、Head、Body。 |
0 |
| ParameterDescription |
string |
描述 |
description1 |
| DefaultValue |
string |
默认值 |
default1 |
| ParameterOperator |
integer |
运算符,可选枚举值有:
向导 API 支持 Equal、Like、In;脚本 API 支持 Equal;注册 API 支持 Equal、Const。 |
0 |
| ExampleValue |
string |
示例值 |
example1 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
高级脚本还有以下数据类型:
|
0 |
| IsRequiredParameter |
boolean |
是否必填 |
true |
| ScriptResponseParameters |
array<object> |
脚本 API 返回参数列表 |
|
|
object |
|||
| ParameterDescription |
string |
描述 |
description2 |
| ParameterName |
string |
参数名称 |
param2 |
| ExampleValue |
string |
示例值 |
example2 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| ScriptConnection |
object |
脚本 API 数据源信息 |
|
| TableName |
string |
数据源表名 |
t |
| ConnectionId |
integer |
数据源 ID |
123 |
| WizardDetails |
object |
向导 API 详情,只有向导 API 返回。 |
|
| IsPagedResponse |
boolean |
返回是否分页。 |
true |
| SuccessfulResultSample |
string |
正常返回示例。 |
{"success": true} |
| FailedResultSample |
string |
错误返回示例。 |
{"success": false} |
| WizardErrorCodes |
array<object> |
向导 API 的错误码列表。 |
|
|
object |
|||
| ErrorMessage |
string |
错误信息。 |
fail to call |
| ErrorCode |
string |
错误码。 |
1001 |
| ErrorSolution |
string |
错误解决方案。 |
retry |
| WizardRequestParameters |
array<object> |
向导 API 的请求参数列表。 |
|
|
object |
|||
| ParameterName |
string |
参数的名称。 |
param1 |
| ParameterPosition |
integer |
参数的位置,可选枚举值包括 0(Path)、1(Query)、2(Head)和 3(Body)。向导和脚本 API 仅支持 Query。注册 API 中的 GET、DELETE 方法支持 Query、Head,PUT、POST 方法支持 Query、Head 和 Body。 |
0 |
| ParameterDescription |
string |
描述信息。 |
description1 |
| DefaultValue |
string |
默认值。 |
default1 |
| ParameterOperator |
integer |
运算符,可选枚举值包括 0(Equal)、1(Like)、2(Const)和 3(In)。向导模式 API 支持 Equal、Like 和 In,脚本模式 API 支持 Equal,注册 API 支持 Equal 和 Const。 |
0 |
| ExampleValue |
string |
示例值。 |
example1 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| IsRequiredParameter |
boolean |
是否必填。 |
true |
| WizardResponseParameters |
array<object> |
向导 API 的返回参数列表。 |
|
|
object |
|||
| ParameterDescription |
string |
描述信息。 |
description2 |
| ParameterName |
string |
参数的名称。 |
param2 |
| ExampleValue |
string |
示例值。 |
example2 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| WizardConnection |
object |
向导 API 的数据源信息。 |
|
| TableName |
string |
数据源的表名称。 |
t |
| ConnectionId |
integer |
数据源 ID。 |
12354 |
| SqlMode |
integer |
SQL 模式,0:基础 SQL;1:高级 SQL |
0 |
不同类型 API 的详情信息通过不同字段返回。向导 API 使用 WizardDetails 字段,脚本 API 使用 ScriptDetails 字段,注册 API 使用 RegistrationDetails 字段。
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"RequestId": "0000-ABCD-EFG****",
"ErrorMessage": "The connection does not exist.",
"Success": true,
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"Data": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 100,
"Apis": [
{
"Timeout": 10000,
"Status": 1,
"ApiId": 10002,
"ApiMode": 0,
"ProjectId": 10000,
"ResponseContentType": 0,
"CreatorId": "1234567",
"VisibleRange": 0,
"ModifiedTime": "2020-06-23T00:21:01+0800",
"OperatorId": "2345678",
"GroupId": "ab123",
"Description": "Test API description",
"RequestMethod": 0,
"CreatedTime": "2020-06-23T00:21:01+0800",
"ApiName": "My API name",
"TenantId": 10001,
"ApiPath": "/test/1",
"Protocols": [
0
],
"RegistrationDetails": {
"ServiceHost": "http://www.abc.com",
"ServiceContentType": 0,
"ServicePath": "/index",
"SuccessfulResultSample": "{\"success\": true}",
"FailedResultSample": "{\"success\": false}",
"ServiceRequestBodyDescription": "{\"abc\":1}",
"RegistrationErrorCodes": [
{
"ErrorMessage": "fail to call",
"ErrorCode": "1001",
"ErrorSolution": "retry"
}
],
"RegistrationRequestParameters": [
{
"ParameterName": "name1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ExampleValue": "example1",
"ParameterDataType": 0,
"IsRequiredParameter": true
}
]
},
"ScriptDetails": {
"IsPagedResponse": true,
"SuccessfulResultSample": "{\"success\": true}",
"FailedResultSample": "{\"success\": false}",
"Script": "select a from t",
"ScriptErrorCodes": [
{
"ErrorMessage": "fail to call",
"ErrorCode": "1001",
"ErrorSolution": "retry"
}
],
"ScriptRequestParameters": [
{
"ParameterName": "param1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ExampleValue": "example1",
"ParameterDataType": 0,
"IsRequiredParameter": true
}
],
"ScriptResponseParameters": [
{
"ParameterDescription": "description2",
"ParameterName": "param2",
"ExampleValue": "example2",
"ParameterDataType": 0
}
],
"ScriptConnection": {
"TableName": "t",
"ConnectionId": 123
}
},
"WizardDetails": {
"IsPagedResponse": true,
"SuccessfulResultSample": "{\"success\": true}",
"FailedResultSample": "{\"success\": false}",
"WizardErrorCodes": [
{
"ErrorMessage": "fail to call",
"ErrorCode": "1001",
"ErrorSolution": "retry"
}
],
"WizardRequestParameters": [
{
"ParameterName": "param1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ExampleValue": "example1",
"ParameterDataType": 0,
"IsRequiredParameter": true
}
],
"WizardResponseParameters": [
{
"ParameterDescription": "description2",
"ParameterName": "param2",
"ExampleValue": "example2",
"ParameterDataType": 0
}
],
"WizardConnection": {
"TableName": "t",
"ConnectionId": 12354
}
},
"SqlMode": 0
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 500 | InternalError.System | An internal system error occurred. Try again later. | |
| 500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | |
| 403 | Forbidden.Access | Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. | 没有权限,请授权 |
| 429 | Throttling.Api | The request for this resource has exceeded your available limit. | |
| 429 | Throttling.System | The DataWorks system is busy. Try again later. | |
| 429 | Throttling.User | Your request is too frequent. Try again later. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。