调用GetDataServiceApi查询数据服务API开发态的详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TenantId |
integer |
否 |
租户 ID。 |
10002 |
| ProjectId |
integer |
是 |
工作空间的 ID。 可通过 ListProjects 响应中的 PageResult.ProjectList[].ProjectId 获取。 |
10001 |
| ApiId |
integer |
是 |
数据服务 API 的 ID。 可通过 ListDataServiceApis 响应中的 Data.Apis[].ApiId 获取。 |
10000 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回对象 |
||
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| RequestId |
string |
请求 ID,一次请求的唯一标识。 |
0000-ABCD-EFG**** |
| ErrorMessage |
string |
错误信息。 |
The specified parameters are invalid. |
| Success |
boolean |
调用是否成功。 |
true |
| ErrorCode |
string |
错误码。 |
1031203110005 |
| Data |
object |
返回数据。 |
|
| Timeout |
integer |
超时时间,单位为毫秒(ms)。 |
10000 |
| Status |
integer |
API 的状态,可选枚举值包括 0(未发布)和 1(已发布)。 |
0 |
| ApiId |
integer |
数据服务 API 的 ID。 |
10000 |
| ApiMode |
integer |
API 的类型,可选枚举值包括 0(向导 API)、1(脚本 API)和 2(注册 API)。 |
0 |
| ProjectId |
integer |
工作空间的 ID。 |
10001 |
| 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 |
描述信息。 |
测试API描述 |
| FolderId |
integer |
文件夹 ID |
0 |
| RequestMethod |
integer |
API 的请求方式,可选枚举值包括 0(GET)、1(POST)、2(PUT)和 3(DELETE)。向导和脚本 API 支持 GET 和 POST。注册 API 支持 GET、POST、PUT 和 DELETE。 |
0 |
| CreatedTime |
string |
创建时间。 格式示例为 |
2020-06-23T00:21:01+0800 |
| ApiName |
string |
API 的名称。 |
测试API名称 |
| TenantId |
integer |
租户 ID。 |
10002 |
| ApiPath |
string |
API 的路径。 |
/test/1 |
| Protocols |
array |
字段列表 |
|
|
integer |
API 协议,多值列表,可选枚举值包括 0(HTTP)和 1(HTTPS)。 |
0 |
|
| RegistrationDetails |
object |
注册 API 的详情,只有注册 API 返回。 |
|
| ServiceHost |
string |
后端服务地址 |
http://example.aliyundoc.com |
| ServiceContentType |
integer |
API 返回数据类型,可选枚举值:
向导和脚本 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 |
返回对象 |
||
| ErrorMessage |
string |
错误信息。 |
fail to call |
| ErrorCode |
string |
错误码。 |
1001 |
| ErrorSolution |
string |
错误解决方案。 |
retry |
| RegistrationRequestParameters |
array<object> |
注册 API 的请求参数列表。 |
|
|
object |
返回对象 |
||
| ColumnName |
string |
绑定的表字段名称,仅向导模式支持。 |
column1 |
| 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 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| ExampleValue |
string |
示例值。 |
example1 |
| IsRequiredParameter |
boolean |
是否必填。 |
true |
| ScriptDetails |
object |
脚本 API 的详情,只有脚本 API 返回。 |
|
| Script |
string |
SQL 脚本。 |
select a from t |
| IsPagedResponse |
boolean |
返回是否分页。 |
true |
| ScriptRequestParameters |
array<object> |
脚本 API 的请求参数列表。 |
|
|
object |
返回对象 |
||
| ColumnName |
string |
绑定的表字段名称,仅向导模式支持。 |
column1 |
| 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 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| ExampleValue |
string |
示例值。 |
example1 |
| IsRequiredParameter |
boolean |
是否必填。 |
true |
| ScriptResponseParameters |
array<object> |
脚本 API 的返回参数列表。 |
|
|
object |
返回对象 |
||
| ParameterDescription |
string |
描述信息。 |
description2 |
| ColumnName |
string |
绑定的表字段名称,仅向导模式支持。 |
column2 |
| ParameterName |
string |
参数的名称。 |
param2 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| ExampleValue |
string |
示例值。 |
example2 |
| ScriptConnection |
object |
脚本 API 的数据源信息。 |
|
| TableName |
string |
数据源表的名称。 |
t |
| ConnectionId |
integer |
数据源 ID。 |
123 |
| WizardDetails |
object |
向导 API 详情,只有向导 API 返回。 |
|
| IsPagedResponse |
boolean |
返回是否分页。 |
true |
| WizardRequestParameters |
array<object> |
向导 API 的请求参数列表。 |
|
|
object |
返回对象 |
||
| ColumnName |
string |
绑定的表字段名称,仅向导模式支持。 |
column1 |
| 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 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| ExampleValue |
string |
示例值。 |
example1 |
| IsRequiredParameter |
boolean |
是否必填。 |
true |
| WizardResponseParameters |
array<object> |
向导模式的返回参数列表。 |
|
|
object |
返回对象 |
||
| ParameterDescription |
string |
描述信息。 |
description2 |
| ColumnName |
string |
绑定的表字段名称,仅向导模式支持。 |
column2 |
| ParameterName |
string |
参数的名称。 |
param2 |
| ParameterDataType |
integer |
数据类型,可选枚举值:
|
0 |
| ExampleValue |
string |
示例值。 |
example2 |
| WizardConnection |
object |
向导 API 的数据源信息。 |
|
| TableName |
string |
数据源的表名称。 |
t |
| ConnectionId |
integer |
数据源 ID。 |
123 |
| ApigwVersion |
integer |
网关版本,1:API 网关;2:云原生 API 网关 |
1 |
| CloudNativeApiGwAuthType |
integer |
云原生 API 网关安全认证方式,1:无认证;2:ApiKey;3:JWT;4:HMAC |
1 |
不同类型 API 的详情信息通过不同字段返回。向导 API 使用 WizardDetails 字段,脚本 API 使用 ScriptDetails 字段,注册 API 使用 RegistrationDetails 字段。
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"RequestId": "0000-ABCD-EFG****",
"ErrorMessage": "The specified parameters are invalid.",
"Success": true,
"ErrorCode": "1031203110005",
"Data": {
"Timeout": 10000,
"Status": 0,
"ApiId": 10000,
"ApiMode": 0,
"ProjectId": 10001,
"ResponseContentType": 0,
"CreatorId": "1234567",
"VisibleRange": 0,
"ModifiedTime": "2020-06-23T00:21:01+0800",
"OperatorId": "2345678",
"GroupId": "ab123****",
"Description": "测试API描述",
"FolderId": 0,
"RequestMethod": 0,
"CreatedTime": "2020-06-23T00:21:01+0800",
"ApiName": "测试API名称",
"TenantId": 10002,
"ApiPath": "/test/1",
"Protocols": [
0
],
"RegistrationDetails": {
"ServiceHost": "http://example.aliyundoc.com",
"ServiceContentType": 0,
"ServicePath": "/index",
"SuccessfulResultSample": "{\"success\": true}",
"FailedResultSample": "{\"success\": false}",
"ServiceRequestBodyDescription": "{\"abc\":1}",
"RegistrationErrorCodes": [
{
"ErrorMessage": "fail to call",
"ErrorCode": "1001",
"ErrorSolution": "retry"
}
],
"RegistrationRequestParameters": [
{
"ColumnName": "column1",
"ParameterName": "name1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ParameterDataType": 0,
"ExampleValue": "example1",
"IsRequiredParameter": true
}
]
},
"ScriptDetails": {
"Script": "select a from t",
"IsPagedResponse": true,
"ScriptRequestParameters": [
{
"ColumnName": "column1",
"ParameterName": "param1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ParameterDataType": 0,
"ExampleValue": "example1",
"IsRequiredParameter": true
}
],
"ScriptResponseParameters": [
{
"ParameterDescription": "description2",
"ColumnName": "column2",
"ParameterName": "param2",
"ParameterDataType": 0,
"ExampleValue": "example2"
}
],
"ScriptConnection": {
"TableName": "t",
"ConnectionId": 123
}
},
"WizardDetails": {
"IsPagedResponse": true,
"WizardRequestParameters": [
{
"ColumnName": "column1",
"ParameterName": "param1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ParameterDataType": 0,
"ExampleValue": "example1",
"IsRequiredParameter": true
}
],
"WizardResponseParameters": [
{
"ParameterDescription": "description2",
"ColumnName": "column2",
"ParameterName": "param2",
"ParameterDataType": 0,
"ExampleValue": "example2"
}
],
"WizardConnection": {
"TableName": "t",
"ConnectionId": 123
}
},
"ApigwVersion": 1,
"CloudNativeApiGwAuthType": 1
}
}
错误码
|
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. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。