All Products
Search
Document Center

DataWorks:GetDataServicePublishedApi

Last Updated:Jun 11, 2026

Mengambil detail API DataService Studio yang dipublikasikan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

ID workspace.

10002

TenantId

integer

No

ID tenant. Untuk mendapatkan ID tenant, lakukan langkah-langkah berikut: Masuk ke konsol DataWorks. Temukan workspace Anda dan buka halaman DataStudio. Pada halaman DataStudio, klik nama pengguna login di pojok kanan atas dan klik User Info di bagian Menu.

10003

ApiId

integer

Yes

ID API.

10001

Elemen respons

Element

Type

Description

Example

object

HttpStatusCode

integer

Kode status HTTP yang dikembalikan.

200

RequestId

string

ID permintaan.

0000-ABCD-EFG****

ErrorMessage

string

Pesan kesalahan yang dikembalikan.

The connection does not exist.

Success

boolean

Menunjukkan apakah permintaan berhasil.

true

ErrorCode

string

Kode kesalahan yang dikembalikan.

Invalid.Tenant.ConnectionNotExists

Data

object

Informasi tentang API yang dipublikasikan.

Timeout

integer

Periode waktu habis permintaan API. Satuan: milidetik.

10000

Status

integer

Status API. Nilai yang valid: 0 dan 1. Nilai 0 menunjukkan bahwa API tidak dipublikasikan. Nilai 1 menunjukkan bahwa API dipublikasikan.

1

ApiId

integer

ID API DataService Studio.

10000

ApiMode

integer

Tipe API. Nilai yang valid: 0, 1, dan 2. Nilai 0 menunjukkan bahwa API dibuat dalam mode wizard. Nilai 1 menunjukkan bahwa API dibuat dalam mode skrip. Nilai 2 menunjukkan bahwa API dibuat melalui registrasi.

0

ProjectId

integer

ID workspace.

10001

ResponseContentType

integer

Format yang digunakan untuk mengembalikan respons permintaan API. Nilai yang valid: 0 dan 1. Nilai 0 menunjukkan format JSON. Nilai 1 menunjukkan format XML. API yang dibuat dalam mode wizard atau skrip mendukung format JSON. API yang dibuat melalui registrasi mendukung format JSON dan XML.

0

CreatorId

string

ID akun Alibaba Cloud yang digunakan oleh pembuat API.

1234567

VisibleRange

integer

Cakupan tempat API terlihat. Nilai yang valid: 0 dan 1. Nilai 0 menunjukkan bahwa API terlihat oleh anggota dalam workspace tertentu. Nilai 1 menunjukkan bahwa API hanya terlihat oleh pembuat API.

0

ModifiedTime

string

Waktu saat API terakhir diubah.

2020-06-23T00:21:01+0800

OperatorId

string

ID akun Alibaba Cloud yang digunakan oleh pengguna yang terakhir mengubah API.

2345678

GroupId

string

ID grup.

ab12**

Description

string

Deskripsi.

测试API描述

RequestMethod

integer

Metode permintaan API. Nilai yang valid: 0, 1, 2, dan 3. Nilai 0 menunjukkan metode GET, nilai 1 menunjukkan metode POST, nilai 2 menunjukkan metode PUT, dan nilai 3 menunjukkan metode DELETE. API yang dibuat dalam mode wizard atau skrip mendukung metode GET dan POST. API yang dibuat melalui registrasi mendukung metode GET, POST, PUT, dan DELETE.

0

CreatedTime

string

Waktu pembuatan.

2020-06-23T00:21:01+0800

ApiName

string

Nama API.

测试API名称

TenantId

integer

ID tenant.

10001

ApiPath

string

Jalur API.

/test/1

Protocols

array

Protokol yang digunakan oleh API. Nilai yang valid: 0 dan 1. Nilai 0 menunjukkan HTTP. Nilai 1 menunjukkan HTTPS. Beberapa protokol disajikan dalam sebuah daftar.

integer

Protokol yang digunakan oleh API. Nilai yang valid: 0 dan 1. Nilai 0 menunjukkan bahwa API menggunakan HTTP. Nilai 1 menunjukkan bahwa API menggunakan HTTPS. Dua protokol disajikan dalam sebuah daftar.

0

RegistrationDetails

object

Detail API yang terdaftar. Hanya dikembalikan untuk API yang terdaftar.

ServiceHost

string

The URL of the backend service.

http://www.abc.com

ServiceContentType

integer

The format in which the response of the API request is returned. Valid values: 0 and 1. The value 0 indicates the JSON format. The value 1 indicates the XML format. APIs generated in wizard or script mode support the JSON format. APIs generated by registration support the JSON and XML formats.

0

ServicePath

string

The path of the backend service.

/index

SuccessfulResultSample

string

The sample success response of the API.

{"success": true}

FailedResultSample

string

The sample error response of the API.

{"success": false}

ServiceRequestBodyDescription

string

The description of the request body initiated to call the backend service.

{"abc":1}

RegistrationErrorCodes

array<object>

The list of error codes for the registered API.

object

ErrorMessage

string

The error message.

The connection does not exist.

ErrorCode

string

The error code.

Invalid.Tenant.ConnectionNotExists

ErrorSolution

string

The solution.

retry

RegistrationRequestParameters

array<object>

The list of request parameters for the registered API.

object

ParameterName

string

The name of the parameter.

name1

ParameterPosition

integer

The position of the parameter. Valid values: 0, 1, 2, and 3. The value 0 indicates that the parameter is in the URL path of the request. The value 1 indicates that the parameter is in the Query parameter of the request URL. The value 2 indicates that the parameter is in the request header. The value 3 indicates that the parameter is in the request body. APIs generated in wizard or script mode support only the Query position. APIs generated by registration whose request method is GET or DELETE support the Query and Head positions. APIs generated by registration whose request method is PUT or POST support the Query, Head, and Body positions.

0

ParameterDescription

string

The description.

description1

DefaultValue

string

The default value.

default1

ParameterOperator

integer

The operator used for the value of the parameter. Valid values: 0, 1, 2, and 3. The value 0 indicates the Equal operator. The value 1 indicates the Like operator. The value 2 indicates the Const operator. The value 3 indicates the In operator. APIs generated in wizard mode support the Equal, Like, and In operators. APIs generated in script mode support the Equal operator. APIs generated by registration support the Equal and Const operators.

0

ExampleValue

string

The sample value.

example1

ParameterDataType

integer

The data type of the parameter. Valid values:

  • 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

Indicates whether the parameter is required.

true

ScriptDetails

object

Detail API yang dibuat dalam mode skrip. Parameter ini hanya dikembalikan jika API dibuat dalam mode skrip.

IsPagedResponse

boolean

Indicates whether the entries were returned by page.

true

SuccessfulResultSample

string

The sample success response of the API.

{"success": true}

FailedResultSample

string

The sample error response of the API.

{"success": false}

Script

string

The SQL script.

select a from t

ScriptErrorCodes

array<object>

The error codes returned for the API generated in script mode.

object

ErrorMessage

string

The error message.

fail to call

ErrorCode

string

The error code.

1001

ErrorSolution

string

The solution used to fix the error.

retry

ScriptRequestParameters

array<object>

The request parameters of the API generated in script mode.

object

ParameterName

string

The name of the parameter.

param1

ParameterPosition

integer

The position of the parameter. Valid values:

  • 0: indicates that the parameter is in the URL path of the request.

  • 1: indicates that the parameter is in the Query parameter of the request URL.

  • 2: indicates that the parameter is in the request header.

  • 3: indicates that the parameter is in the request body.

APIs generated in wizard or script mode support only the Query position. APIs generated by registration whose request method is GET or DELETE support the Query and Head positions. APIs generated by registration whose request method is PUT or POST support the Query, Head, and Body positions.

0

ParameterDescription

string

The description.

description1

DefaultValue

string

The default value.

default1

ParameterOperator

integer

The operator used for the value of the parameter. Valid values:

  • 0: Equal

  • 1: Like

  • 2: Const

  • 3: In

APIs generated in wizard mode support the Equal, Like, and In operators. APIs generated in script mode support the Equal operator. APIs generated by registration support the Equal and Const operators.

0

ExampleValue

string

The sample value.

example1

ParameterDataType

integer

The data type of the parameter. Valid values:

  • 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

Indicates whether the parameter is required.

true

ScriptResponseParameters

array<object>

The response parameters of the API generated in script mode.

object

ParameterDescription

string

The description.

description2

ParameterName

string

The name of the parameter.

param2

ExampleValue

string

The sample value.

example2

ParameterDataType

integer

The data type of the parameter. Valid values:

  • 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

The data source information of the API generated in script mode.

TableName

string

The name of the table in the data source.

t

ConnectionId

integer

The ID of the data source.

123

WizardDetails

object

Detail API yang dibuat dalam mode wizard. Parameter ini hanya dikembalikan jika API dibuat dalam mode wizard.

IsPagedResponse

boolean

Indicates whether the entries were returned by page.

true

SuccessfulResultSample

string

The sample success response of the API.

{"success": true}

FailedResultSample

string

The sample error response of the API.

{"success": false}

WizardErrorCodes

array<object>

The error codes returned for the API generated in wizard mode.

object

ErrorMessage

string

The error message.

fail to call

ErrorCode

string

The error code.

1001

ErrorSolution

string

The solution used to fix the error.

retry

WizardRequestParameters

array<object>

The request parameters of the API generated in wizard mode.

object

ParameterName

string

The name of the parameter.

param1

ParameterPosition

integer

The position of the parameter. Valid values: 0, 1, 2, and 3. The value 0 indicates that the parameter is in the URL path of the request. The value 1 indicates that the parameter is in the Query parameter of the request URL. The value 2 indicates that the parameter is in the request header. The value 3 indicates that the parameter is in the request body. APIs generated in wizard or script mode support only the Query position. APIs generated by registration whose request method is GET or DELETE support the Query and Head positions. APIs generated by registration whose request method is PUT or POST support the Query, Head, and Body positions.

0

ParameterDescription

string

The description.

description1

DefaultValue

string

The default value.

default1

ParameterOperator

integer

The operator used for the value of the parameter. Valid values: 0, 1, 2, and 3. The value 0 indicates the Equal operator. The value 1 indicates the Like operator. The value 2 indicates the Const operator. The value 3 indicates the In operator. APIs generated in wizard mode support the Equal, Like, and In operators. APIs generated in script mode support the Equal operator. APIs generated by registration support the Equal and Const operators.

0

ExampleValue

string

The sample value.

example1

ParameterDataType

integer

The data type of the parameter. Valid values:

  • 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

Indicates whether the parameter is required.

true

WizardResponseParameters

array<object>

The response parameters of the API generated in wizard mode.

object

The returned result.

ParameterDescription

string

The description.

description2

ParameterName

string

The name of the parameter.

param2

ExampleValue

string

The sample value.

example2

ParameterDataType

integer

The data type of the parameter. Valid values:

  • 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

The data source information of the API generated in wizard mode.

TableName

string

The name of the table in the data source.

t

ConnectionId

integer

The ID of the data source.

123

SqlMode

integer

Mode SQL. 0: Basic SQL; 1: Advanced SQL.

0

Detail tipe API yang berbeda dikembalikan dalam field yang berbeda. API Wizard menggunakan field WizardDetails, API skrip menggunakan field ScriptDetails, dan API registrasi menggunakan field RegistrationDetails.

Contoh

Respons sukses

JSONformat

{
  "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
  }
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

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. No permission, please authorize
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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.