調用ListDataServicePublishedApis擷取資料服務API的發布態資訊列表。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| PageNumber |
integer |
否 |
頁碼,從 1 開始,預設值為 1。 |
1 |
| PageSize |
integer |
否 |
每頁顯示的條數,預設為 10 條,最大 50 條。 |
10 |
| ProjectId |
integer |
是 |
工作空間的 ID。 |
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. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。