全部產品
Search
文件中心

DataWorks:GetDataServicePublishedApi - 查詢資料服務API的發布態資訊

更新時間:Mar 21, 2026

調用GetDataServicePublishedApi查詢資料服務API的發布態資訊。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

ProjectId

integer

工作空間的 ID。

10002

TenantId

integer

租戶 ID。您可登入 DataWorks 控制台,進入資料開發(DataStudio)頁面,單擊右上方當前登入使用者名稱稱,選擇菜單 > 使用者資訊,擷取租戶 ID。

10003

ApiId

integer

API 的 ID。

10001

返回參數

名稱

類型

描述

樣本值

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 的最新發行態資訊。

Timeout

integer

逾時時間,單位為毫秒(ms)。

10000

Status

integer

API 的狀態,可選枚舉值包括 0(未發布)和 1(發行)。

1

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。

ab12**

Description

string

描述資訊。

測試API描述

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 的名稱。

測試API名稱

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

ErrorMessage

string

錯誤資訊。

The connection does not exist.

ErrorCode

string

錯誤碼。

Invalid.Tenant.ConnectionNotExists

ErrorSolution

string

錯誤解決方案。

retry

RegistrationRequestParameters

array<object>

註冊 API 的請求參數列表。

object

ParameterName

string

參數的名稱。

name1

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:String

  • 1:Int

  • 2:Long

  • 3:Float

  • 4:Double

  • 5:Boolean

  • 6:StringList

  • 7:IntList

  • 8:LongList

  • 9:FloatList

  • 10:DoubleList

  • 11:BooleanList

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

參數位置,可選枚舉值有:

  • 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:String

  • 1:Int

  • 2:Long

  • 3:Float

  • 4:Double

  • 5:Boolean

  • 6:StringList

  • 7:IntList

  • 8:LongList

  • 9:FloatList

  • 10:DoubleList

  • 11:BooleanList

0

IsRequiredParameter

boolean

是否必填

true

ScriptResponseParameters

array<object>

指令碼 API 的返回參數列表。

object

ParameterDescription

string

描述資訊。

description2

ParameterName

string

參數的名稱。

param2

ExampleValue

string

樣本值。

example2

ParameterDataType

integer

資料類型,可選枚舉值:

  • 0:String

  • 1:Int

  • 2:Long

  • 3:Float

  • 4:Double

  • 5:Boolean

  • 6:StringList

  • 7:IntList

  • 8:LongList

  • 9:FloatList

  • 10:DoubleList

  • 11:BooleanList

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:String

  • 1:Int

  • 2:Long

  • 3:Float

  • 4:Double

  • 5:Boolean

  • 6:StringList

  • 7:IntList

  • 8:LongList

  • 9:FloatList

  • 10:DoubleList

  • 11:BooleanList

0

IsRequiredParameter

boolean

是否必填。

true

WizardResponseParameters

array<object>

嚮導 API 的返回參數列表。

object

嚮導模式的返回參數列表。

ParameterDescription

string

描述資訊。

description2

ParameterName

string

參數的名稱。

param2

ExampleValue

string

樣本值。

example2

ParameterDataType

integer

資料類型,可選枚舉值:

  • 0:String

  • 1:Int

  • 2:Long

  • 3:Float

  • 4:Double

  • 5:Boolean

  • 6:StringList

  • 7:IntList

  • 8:LongList

  • 9:FloatList

  • 10:DoubleList

  • 11:BooleanList

0

WizardConnection

object

嚮導 API 的資料來源資訊。

TableName

string

資料來源的表名稱。

t

ConnectionId

integer

資料來源的 ID。

123

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": {
    "Timeout": 10000,
    "Status": 1,
    "ApiId": 10000,
    "ApiMode": 0,
    "ProjectId": 10001,
    "ResponseContentType": 0,
    "CreatorId": "1234567",
    "VisibleRange": 0,
    "ModifiedTime": "2020-06-23T00:21:01+0800",
    "OperatorId": "2345678",
    "GroupId": "ab12**",
    "Description": "測試API描述",
    "RequestMethod": 0,
    "CreatedTime": "2020-06-23T00:21:01+0800",
    "ApiName": "測試API名稱",
    "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": "The connection does not exist.",
          "ErrorCode": "Invalid.Tenant.ConnectionNotExists",
          "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": 123
      }
    },
    "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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情