All Products
Search
Document Center

DataWorks:GetDataServicePublishedApi

Last Updated:Oct 17, 2024

Queries the information about a DataService Studio API in the published state.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdlongYes

The ID of the workspace.

10002
TenantIdlongNo

The tenant ID. To obtain the tenant ID, perform the following steps: Log on to the DataWorks console. Find your workspace and go to the DataStudio page. On the DataStudio page, click the logon username in the upper-right corner and click User Info in the Menu section.

10003
ApiIdlongYes

The ID of the API.

10001

Response parameters

ParameterTypeDescriptionExample
object
HttpStatusCodeinteger

The HTTP status code returned.

200
RequestIdstring

The ID of the request.

0000-ABCD-EFG****
ErrorMessagestring

The error message returned.

The connection does not exist.
Successboolean

Indicates whether the request was successful.

true
ErrorCodestring

The error code returned.

Invalid.Tenant.ConnectionNotExists
Dataobject

The latest information about the API in the published state.

Timeoutinteger

The timeout period of the API request. Unit: milliseconds.

10000
Statusinteger

The status of the API. Valid values: 0 and 1. The value 0 indicates that the API is not published. The value 1 indicates that the API is published.

1
ApiIdlong

The ID of the DataService Studio API.

10000
ApiModeinteger

The type of the API. Valid values: 0, 1, and 2. The value 0 indicates that the API is generated in wizard mode. The value 1 indicates that the API is generated in script mode. The value 2 indicates that the API is generated by registration.

0
ProjectIdlong

The ID of the workspace.

10001
ResponseContentTypeinteger

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
CreatorIdstring

The ID of the Alibaba Cloud account used by the creator of the API.

1234567
VisibleRangeinteger

The scope in which the API is visible. Valid values: 0 and 1. The value 0 indicates that the API is visible to the members in a specific workspace. The value 1 indicates that the API is visible only to the API creator.

0
ModifiedTimestring

The time when the API was last modified.

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

The ID of the Alibaba Cloud account used by the user who last modified the API.

2345678
GroupIdstring

The ID of the group.

ab12**
Descriptionstring

The description.

Description of the test API
RequestMethodinteger

The request method of the API. Valid values: 0, 1, 2, and 3. The value 0 indicates the GET method, the value 1 indicates the POST method, the value 2 indicates the PUT method, and the value 3 indicates the DELETE method. APIs generated in wizard or script mode support the GET and POST methods. APIs generated by registration support the GET, POST, PUT, and DELETE methods.

0
CreatedTimestring

The creation time.

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

The name of the API.

Name of the test API
TenantIdlong

The ID of the tenant.

10001
ApiPathstring

The path of the API.

/test/1
Protocolsarray

The protocol used by the API. Valid values: 0 and 1. The value 0 indicates HTTP. The value 1 indicates HTTPS. Multiple protocols are presented in a list.

Protocolinteger

The protocol used by the API. Valid values: 0 and 1. The value 0 indicates that the API uses HTTP. The value 1 indicates that the API uses HTTPS. Two protocols are presented in a list.

0
RegistrationDetailsobject

The details of the API generated by registration. This parameter is returned only if the API is generated by registration.

ServiceHoststring

The URL of the backend service.

http://example.aliyundoc.com
ServiceContentTypeinteger

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
ServicePathstring

The path of the backend service.

/index
SuccessfulResultSamplestring

The sample success response of the API.

{"success": true}
FailedResultSamplestring

The sample error response of the API.

{"success": false}
ServiceRequestBodyDescriptionstring

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

{"abc":1}
RegistrationErrorCodesarray<object>

The error codes returned for the API generated by registration.

RegistrationErrorCodeobject

The returned result.

ErrorMessagestring

The error message.

The connection does not exist.
ErrorCodestring

The error code.

Invalid.Tenant.ConnectionNotExists
ErrorSolutionstring

The solution used to fix the error.

retry
RegistrationRequestParametersarray<object>

The request parameters of the API generated by registration.

RegistrationRequestParameterobject

The returned result.

ParameterNamestring

The name of the parameter.

name1
ParameterPositioninteger

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
ParameterDescriptionstring

The description.

description1
DefaultValuestring

The default value.

default1
ParameterOperatorinteger

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
ExampleValuestring

The sample value.

example1
ParameterDataTypeinteger

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
IsRequiredParameterboolean

Indicates whether the parameter is required.

true
ScriptDetailsobject

The details of the API generated in script mode. This parameter is returned only if the API is generated in script mode.

IsPagedResponseboolean

Indicates whether the entries were returned by page.

true
SuccessfulResultSamplestring

The sample success response of the API.

{"success": true}
FailedResultSamplestring

The sample error response of the API.

{"success": false}
Scriptstring

The SQL script.

select a from t
ScriptErrorCodesarray<object>

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

ScriptErrorCodeobject

The returned result.

ErrorMessagestring

The error message.

fail to call
ErrorCodestring

The error code.

1001
ErrorSolutionstring

The solution used to fix the error.

retry
ScriptRequestParametersarray<object>

The request parameters of the API generated in script mode.

ScriptRequestParameterobject

The returned result.

ParameterNamestring

The name of the parameter.

param1
ParameterPositioninteger

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
ParameterDescriptionstring

The description.

description1
DefaultValuestring

The default value.

default1
ParameterOperatorinteger

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
ExampleValuestring

The sample value.

example1
ParameterDataTypeinteger

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
IsRequiredParameterboolean

Indicates whether the parameter is required.

true
ScriptResponseParametersarray<object>

The response parameters of the API generated in script mode.

ScriptResponseParameterobject

The returned result.

ParameterDescriptionstring

The description.

description2
ParameterNamestring

The name of the parameter.

param2
ExampleValuestring

The sample value.

example2
ParameterDataTypeinteger

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
ScriptConnectionobject

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

TableNamestring

The name of the table in the data source.

t
ConnectionIdlong

The ID of the data source.

123
WizardDetailsobject

The details of the API generated in wizard mode. This parameter is returned only if the API is generated in wizard mode.

IsPagedResponseboolean

Indicates whether the entries were returned by page.

true
SuccessfulResultSamplestring

The sample success response of the API.

{"success": true}
FailedResultSamplestring

The sample error response of the API.

{"success": false}
WizardErrorCodesarray<object>

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

WizardErrorCodeobject

The returned result.

ErrorMessagestring

The error message.

fail to call
ErrorCodestring

The error code.

1001
ErrorSolutionstring

The solution used to fix the error.

retry
WizardRequestParametersarray<object>

The request parameters of the API generated in wizard mode.

WizardRequestParameterobject

The returned result.

ParameterNamestring

The name of the parameter.

param1
ParameterPositioninteger

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
ParameterDescriptionstring

The description.

description1
DefaultValuestring

The default value.

default1
ParameterOperatorinteger

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
ExampleValuestring

The sample value.

example1
ParameterDataTypeinteger

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
IsRequiredParameterboolean

Indicates whether the parameter is required.

true
WizardResponseParametersarray<object>

The response parameters of the API generated in wizard mode.

WizardResponseParameterobject

The returned result.

ParameterDescriptionstring

The description.

description2
ParameterNamestring

The name of the parameter.

param2
ExampleValuestring

The sample value.

example2
ParameterDataTypeinteger

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
WizardConnectionobject

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

TableNamestring

The name of the table in the data source.

t
ConnectionIdlong

The ID of the data source.

123

The details about the APIs of different types are returned in different parameters. The details about the API generated in wizard mode are returned in the WizardDetails parameter. The details about the API generated in script mode are returned in the ScriptDetails parameter. The details about the API generated by registration are returned in the RegistrationDetails parameter.

Examples

Sample success responses

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": "Description of the test API\n",
    "RequestMethod": 0,
    "CreatedTime": "2020-06-23T00:21:01+0800",
    "ApiName": "Name of the test API\n",
    "TenantId": 10001,
    "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": "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
      }
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
403Forbidden.AccessAccess is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.No permission, please authorize
429Throttling.ApiThe request for this resource has exceeded your available limit.-
429Throttling.SystemThe DataWorks system is busy. Try again later.-
429Throttling.UserYour request is too frequent. Try again later.-
500InternalError.SystemAn internal system error occurred. Try again later.-
500InternalError.UserId.MissingAn internal system error occurred. Try again later.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-10The Error code has changedView Change Details