All Products
Search
Document Center

:GetDataServicePublishedApi

最終更新日:May 10, 2024

Queries the information about an API in the published state.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

GetDataServicePublishedApi

The operation that you want to perform. Set the value to GetDataServicePublishedApi.

ProjectId

Long

Yes

10002

The workspace ID.

TenantId

Long

No

10003

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.

ApiId

Long

Yes

10001

The API ID.

Response parameters

Parameter

Type

Example

Description

HttpStatusCode

Integer

200

The HTTP status code.

RequestId

String

0000-ABCD-EFG****

The request ID.

ErrorMessage

String

The connection does not exist.

The error message.

Success

Boolean

true

Indicates whether the request was successful.

ErrorCode

String

Invalid.Tenant.ConnectionNotExists

The error code.

Data

Object

The latest information about the API in the published state.

Timeout

Integer

10000

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

Status

Integer

1

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.

ApiId

Long

10000

The API ID.

ApiMode

Integer

0

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.

ProjectId

Long

10001

The workspace ID.

ResponseContentType

Integer

0

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.

CreatorId

String

1234567

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

VisibleRange

Integer

0

The scope in which the API is visible. Valid values: 0 and 1. The value 0 indicates that the API is visible within the workspace. The value 1 indicates that the API is visible only to its owner.

ModifiedTime

String

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

The time when the API was last modified.

OperatorId

String

2345678

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

GroupId

String

ab12**

The group ID.

Description

String

Description of the test API

The description.

RequestMethod

Integer

0

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. 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.

CreatedTime

String

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

The time when the API was created.

ApiName

String

Name of the test API

The name of the API.

TenantId

Long

10001

The tenant ID.

ApiPath

String

/test/1

The path of the API.

Protocols

Array of Integer

0

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.

RegistrationDetails

Object

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

ServiceHost

String

http://www.abc.com

The URL of the backend service.

ServiceContentType

Integer

0

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.

ServicePath

String

/index

The path of the backend service.

SuccessfulResultSample

String

{"success": true}

The sample success response of the API.

FailedResultSample

String

{"success": false}

The sample error response of the API.

ServiceRequestBodyDescription

String

{"abc":1}

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

RegistrationErrorCodes

Array of RegistrationErrorCode

The error codes returned for the API generated by registration.

ErrorMessage

String

The connection does not exist.

The error message.

ErrorCode

String

Invalid.Tenant.ConnectionNotExists

The error code.

ErrorSolution

String

retry

The solution used to fix the error.

RegistrationRequestParameters

Array of RegistrationRequestParameter

The request parameters of the API generated by registration.

ParameterName

String

name1

The name of the parameter.

ParameterPosition

Integer

0

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.

ParameterDescription

String

description1

The description.

DefaultValue

String

default1

The default value.

ParameterOperator

Integer

0

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.

ExampleValue

String

example1

The sample value.

ParameterDataType

Integer

0

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

IsRequiredParameter

Boolean

true

Indicates whether the parameter is required.

ScriptDetails

Object

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

IsPagedResponse

Boolean

true

Indicates whether the entries are returned by page.

SuccessfulResultSample

String

{"success": true}

The sample success response of the API.

FailedResultSample

String

{"success": false}

The sample error response of the API.

Script

String

select a from t

The SQL script.

ScriptErrorCodes

Array of ScriptErrorCode

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

ErrorMessage

String

fail to call

The error message.

ErrorCode

String

1001

The error code.

ErrorSolution

String

retry

The solution used to fix the error.

ScriptRequestParameters

Array of ScriptRequestParameter

The request parameters of the API generated in script mode.

ParameterName

String

param1

The name of the parameter.

ParameterPosition

Integer

0

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.

ParameterDescription

String

description1

The description.

DefaultValue

String

default1

The default value.

ParameterOperator

Integer

0

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.

ExampleValue

String

example1

The sample value.

ParameterDataType

Integer

0

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

IsRequiredParameter

Boolean

true

Indicates whether the request parameter is required.

ScriptResponseParameters

Array of ScriptResponseParameter

The response parameters of the API generated in script mode.

ParameterDescription

String

description2

The description.

ParameterName

String

param2

The name of the parameter.

ExampleValue

String

example2

The sample value.

ParameterDataType

Integer

0

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

ScriptConnection

Object

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

TableName

String

t

The name of the table in the data source.

ConnectionId

Long

123

The data source ID.

WizardDetails

Object

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

IsPagedResponse

Boolean

true

Indicates whether the entries are returned by page.

SuccessfulResultSample

String

{"success": true}

The sample success response of the API.

FailedResultSample

String

{"success": false}

The sample error response of the API.

WizardErrorCodes

Array of WizardErrorCode

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

ErrorMessage

String

fail to call

The error message.

ErrorCode

String

1001

The error code.

ErrorSolution

String

retry

The solution used to fix the error.

WizardRequestParameters

Array of WizardRequestParameter

The request parameters of the API generated in wizard mode.

ParameterName

String

param1

The name of the parameter.

ParameterPosition

Integer

0

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.

ParameterDescription

String

description1

The description.

DefaultValue

String

default1

The default value.

ParameterOperator

Integer

0

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.

ExampleValue

String

example1

The sample value.

ParameterDataType

Integer

0

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

IsRequiredParameter

Boolean

true

Indicates whether the parameter is required.

WizardResponseParameters

Array of WizardResponseParameter

The response parameters of the API generated in wizard mode.

ParameterDescription

String

description2

The description.

ParameterName

String

param2

The name of the parameter.

ExampleValue

String

example2

The sample value.

ParameterDataType

Integer

0

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

WizardConnection

Object

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

TableName

String

t

The name of the table in the data source.

ConnectionId

Long

123

The data source ID.

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

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetDataServicePublishedApi
&ProjectId=10002
&TenantId=10003
&ApiId=10001
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetDataServicePublishedApiResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>0000-ABCD-EFG****</RequestId>
    <ErrorMessage>The connection does not exist.</ErrorMessage>
    <Success>true</Success>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Data>
        <Timeout>10000</Timeout>
        <Status>1</Status>
        <ApiId>10000</ApiId>
        <ApiMode>0</ApiMode>
        <ProjectId>10001</ProjectId>
        <ResponseContentType>0</ResponseContentType>
        <CreatorId>1234567</CreatorId>
        <VisibleRange>0</VisibleRange>
        <ModifiedTime>2020-06-23T00:21:01+0800</ModifiedTime>
        <OperatorId>2345678</OperatorId>
        <GroupId>ab12**</GroupId>
        <Description>Description of the test API</Description>
        <RequestMethod>0</RequestMethod>
        <CreatedTime>2020-06-23T00:21:01+0800</CreatedTime>
        <ApiName>Name of the test API</ApiName>
        <TenantId>10001</TenantId>
        <ApiPath>/test/1</ApiPath>
        <Protocols>0</Protocols>
        <RegistrationDetails>
            <ServiceHost>http://www.abc.com</ServiceHost>
            <ServiceContentType>0</ServiceContentType>
            <ServicePath>/index</ServicePath>
            <SuccessfulResultSample>{"success": true}</SuccessfulResultSample>
            <FailedResultSample>{"success": false}</FailedResultSample>
            <ServiceRequestBodyDescription>{"abc":1}</ServiceRequestBodyDescription>
            <RegistrationErrorCodes>
                <ErrorMessage>The connection does not exist.</ErrorMessage>
                <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
                <ErrorSolution>retry</ErrorSolution>
            </RegistrationErrorCodes>
            <RegistrationRequestParameters>
                <ParameterName>name1</ParameterName>
                <ParameterPosition>0</ParameterPosition>
                <ParameterDescription>description1</ParameterDescription>
                <DefaultValue>default1</DefaultValue>
                <ParameterOperator>0</ParameterOperator>
                <ExampleValue>example1</ExampleValue>
                <ParameterDataType>0</ParameterDataType>
                <IsRequiredParameter>true</IsRequiredParameter>
            </RegistrationRequestParameters>
        </RegistrationDetails>
        <ScriptDetails>
            <IsPagedResponse>true</IsPagedResponse>
            <SuccessfulResultSample>{"success": true}</SuccessfulResultSample>
            <FailedResultSample>{"success": false}</FailedResultSample>
            <Script>select a from t</Script>
            <ScriptErrorCodes>
                <ErrorMessage>fail to call</ErrorMessage>
                <ErrorCode>1001</ErrorCode>
                <ErrorSolution>retry</ErrorSolution>
            </ScriptErrorCodes>
            <ScriptRequestParameters>
                <ParameterName>param1</ParameterName>
                <ParameterPosition>0</ParameterPosition>
                <ParameterDescription>description1</ParameterDescription>
                <DefaultValue>default1</DefaultValue>
                <ParameterOperator>0</ParameterOperator>
                <ExampleValue>example1</ExampleValue>
                <ParameterDataType>0</ParameterDataType>
                <IsRequiredParameter>true</IsRequiredParameter>
            </ScriptRequestParameters>
            <ScriptResponseParameters>
                <ParameterDescription>description2</ParameterDescription>
                <ParameterName>param2</ParameterName>
                <ExampleValue>example2</ExampleValue>
                <ParameterDataType>0</ParameterDataType>
            </ScriptResponseParameters>
            <ScriptConnection>
                <TableName>t</TableName>
                <ConnectionId>123</ConnectionId>
            </ScriptConnection>
        </ScriptDetails>
        <WizardDetails>
            <IsPagedResponse>true</IsPagedResponse>
            <SuccessfulResultSample>{"success": true}</SuccessfulResultSample>
            <FailedResultSample>{"success": false}</FailedResultSample>
            <WizardErrorCodes>
                <ErrorMessage>fail to call</ErrorMessage>
                <ErrorCode>1001</ErrorCode>
                <ErrorSolution>retry</ErrorSolution>
            </WizardErrorCodes>
            <WizardRequestParameters>
                <ParameterName>param1</ParameterName>
                <ParameterPosition>0</ParameterPosition>
                <ParameterDescription>description1</ParameterDescription>
                <DefaultValue>default1</DefaultValue>
                <ParameterOperator>0</ParameterOperator>
                <ExampleValue>example1</ExampleValue>
                <ParameterDataType>0</ParameterDataType>
                <IsRequiredParameter>true</IsRequiredParameter>
            </WizardRequestParameters>
            <WizardResponseParameters>
                <ParameterDescription>description2</ParameterDescription>
                <ParameterName>param2</ParameterName>
                <ExampleValue>example2</ExampleValue>
                <ParameterDataType>0</ParameterDataType>
            </WizardResponseParameters>
            <WizardConnection>
                <TableName>t</TableName>
                <ConnectionId>123</ConnectionId>
            </WizardConnection>
        </WizardDetails>
    </Data>
</GetDataServicePublishedApiResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/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" : "Description of the test API",
    "RequestMethod" : 0,
    "CreatedTime" : "2020-06-23T00:21:01+0800",
    "ApiName" : "Name of the test 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
      }
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

429

Throttling.Api

The request for this resource has exceeded your available limit.

The number of requests for the resource has exceeded the upper limit.

429

Throttling.System

The DataWorks system is busy. Try again later.

The DataWorks system is busy. Try again later.

429

Throttling.User

Your request is too frequent. Try again later.

Excessive requests have been submitted within a short period of time. Try again later.

500

InternalError.System

An internal system error occurred. Try again later.

An internal error occurred. Try again later.

500

InternalError.UserId.Missing

An internal system error occurred. Try again later.

An internal error occurred. Try again later.

For a list of error codes, see Service error codes.