全部产品
Search
文档中心

大数据开发治理平台 DataWorks:ListDataServicePublishedApis

更新时间:Sep 21, 2023

调用ListDataServicePublishedApis获取数据服务API的发布态信息列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String ListDataServicePublishedApis

系统规定参数。取值:ListDataServicePublishedApis

PageNumber Integer 1

页码,从1开始,默认值为1。

PageSize Integer 10

每页显示的条数,默认为10条,最大100条。

ProjectId Long 10000

工作空间的ID。

TenantId Long 10001

租户ID。您可登录DataWorks控制台,进入数据开发(DataStudio)页面,单击右上方当前登录用户名称,选择菜单 > 用户信息,获取租户ID。

ApiNameKeyword String 我的API名称

API名称的关键词,过滤得到API名称包含该关键词的API。

ApiPathKeyword String /test/

API路径的关键词,过滤得到API路径包含该关键词的API。

CreatorId String 12345

API创建者的阿里云ID,过滤得到该用户创建的API。

返回数据

名称

类型

示例值

描述

HttpStatusCode Integer 200

HTTP状态码。

RequestId String 0000-ABCD-EFG****

请求ID,一次请求的唯一标识。

ErrorMessage String The connection does not exist.

错误信息。

Success Boolean true

调用是否成功。

ErrorCode String Invalid.Tenant.ConnectionNotExists

错误码。

Data Object

API发布态信息返回。

PageNumber Integer 1

页码,和请求中的PageNumber一致。

PageSize Integer 10

每页显示的条数,默认为10条,最大100条。

TotalCount Integer 100

总记录数。

Apis Array of Api

API发布态信息列表。

Timeout Integer 10000

超时时间,单位毫秒ms

Status Integer 1

API的状态,可选枚举值包括0(未发布)和1(已发布)。

ApiId Long 10002

API的ID。

ApiMode Integer 0

API的类型,可选枚举值包括0(向导API)、1(脚本API)和2(注册API)。

ProjectId Long 10000

工作空间的ID。

ResponseContentType Integer 0

API的返回数据类型,可选枚举值包括0(JSON)和1(XML)。向导和脚本API支持JSON,注册API支持JSON和XML。

CreatorId String 1234567

创建人的阿里云ID。

VisibleRange Integer 0

可见范围,可选枚举值包括0(工作空间)和1(私有)。

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

最新修改时间。

OperatorId String 2345678

最新编辑人阿里云ID

GroupId String ab123

分组ID。

Description String 测试API描述

描述信息。

RequestMethod Integer 0

API的请求方式,可选枚举值包括0(GET)、1(POST)、2(PUT)和3(DELTE)。向导和脚本API支持GET和POST。注册API支持GET、POST、PUT和DELETE。

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

创建时间。

ApiName String 我的API名称

API的名称。

TenantId Long 10001

租户ID。

ApiPath String /test/1

API的路径。

Protocols Array of Integer 0

API协议,可选枚举值包括0(HTTP)和1(HTTPS)。

RegistrationDetails Object

注册API详情,只有注册API返回。

ServiceHost String http://www.abc.com

后端服务地址。

ServiceContentType Integer 0

API的返回数据类型,可选枚举值包括0(JSON)和1(XML)。向导和脚本API支持JSON,注册API支持JSON和XML。

ServicePath String /index

后端服务路径。

SuccessfulResultSample String {"success": true}

正常返回示例。

FailedResultSample String {"success": false}

错误返回示例。

ServiceRequestBodyDescription String {"abc":1}

后端请求body内容的描述。

RegistrationErrorCodes Array of RegistrationErrorCode

注册API的错误码列表。

ErrorMessage String fail to call

错误信息

ErrorCode String 1001

错误码

ErrorSolution String retry

错误解决方案

RegistrationRequestParameters Array of RegistrationRequestParameter

注册API的请求参数列表。

ParameterName String name1

参数名称

ParameterPosition Integer 0

参数位置,可选枚举值有:

  • 0:Path
  • 1:Query
  • 2:Head
  • 3:Body

向导和脚本API,只支持Query;注册API,GET、DELETE方法支持Query、Head,PUT、POST方法支持Query、Head、Body。

ParameterDescription String description1

描述

DefaultValue String default1

默认值

ParameterOperator Integer 0

运算符,可选枚举值有:

  • 0:Equal
  • 1:Like
  • 2:Const
  • 3:In

向导API支持Equal、Like、In;脚本API支持Equal;注册API支持Equal、Const。

ExampleValue String example1

示例值

ParameterDataType Integer 0

数据类型,可选枚举值:

  • 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

是否必填

ScriptDetails Object

脚本API详情,只有脚本API返回。

IsPagedResponse Boolean true

返回是否分页

SuccessfulResultSample String {"success": true}

正常返回示例

FailedResultSample String {"success": false}

错误返回示例

Script String select a from t

SQL脚本

ScriptErrorCodes Array of ScriptErrorCode

脚本API错误码列表

ErrorMessage String fail to call

错误信息

ErrorCode String 1001

错误码

ErrorSolution String retry

错误解决方案

ScriptRequestParameters Array of ScriptRequestParameter

脚本API请求参数列表

ParameterName String param1

参数名称

ParameterPosition Integer 0

参数位置,可选枚举值有:

  • 0:Path
  • 1:Query
  • 2:Head
  • 3:Body

向导和脚本API,只支持Query;注册API,GET、DELETE方法支持Query、Head,PUT、POST方法支持Query、Head、Body。

ParameterDescription String description1

描述

DefaultValue String default1

默认值

ParameterOperator Integer 0

运算符,可选枚举值有:

  • 0:Equal
  • 1:Like
  • 2:Const
  • 3:In

向导API支持Equal、Like、In;脚本API支持Equal;注册API支持Equal、Const。

ExampleValue String example1

示例值

ParameterDataType Integer 0

数据类型,可选枚举值:

  • 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

是否必填

ScriptResponseParameters Array of ScriptResponseParameter

脚本API返回参数列表

ParameterDescription String description2

描述

ParameterName String param2

参数名称

ExampleValue String example2

示例值

ParameterDataType Integer 0

数据类型,可选枚举值:

  • 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

脚本API数据源信息

TableName String t

数据源表名

ConnectionId Long 123

数据源ID

WizardDetails Object

向导API详情,只有向导API返回。

IsPagedResponse Boolean true

返回是否分页。

SuccessfulResultSample String {"success": true}

正常返回示例。

FailedResultSample String {"success": false}

错误返回示例。

WizardErrorCodes Array of WizardErrorCode

向导API的错误码列表。

ErrorMessage String fail to call

错误信息。

ErrorCode String 1001

错误码。

ErrorSolution String retry

错误解决方案。

WizardRequestParameters Array of WizardRequestParameter

向导API的请求参数列表。

ParameterName String param1

参数的名称。

ParameterPosition Integer 0

参数的位置,可选枚举值包括0(Path)、1(Query)、2(Head)和3(Body)。向导和脚本API仅支持Query。注册API中的GET、DELETE方法支持Query、Head,PUT、POST方法支持Query、Head和Body。

ParameterDescription String description1

描述信息。

DefaultValue String default1

默认值。

ParameterOperator Integer 0

运算符,可选枚举值包括0(Equal)、1(Like)、2(Const)和3(In)。向导模式API支持Equal、Like和In,脚本模式API支持Equal,注册API支持Equal和Const。

ExampleValue String example1

示例值。

ParameterDataType Integer 0

数据类型,可选枚举值:

  • 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

是否必填。

WizardResponseParameters Array of WizardResponseParameter

向导API的返回参数列表。

ParameterDescription String description2

描述信息。

ParameterName String param2

参数的名称。

ExampleValue String example2

示例值。

ParameterDataType Integer 0

数据类型,可选枚举值:

  • 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

向导API的数据源信息。

TableName String t

数据源的表名称。

ConnectionId Long 123

数据源ID。

不同类型API的详情信息通过不同字段返回。向导API使用WizardDetails字段,脚本API使用ScriptDetails字段,注册API使用RegistrationDetails字段。

示例

请求示例

http(s)://[Endpoint]/?Action=ListDataServicePublishedApis
&PageNumber=1
&PageSize=10
&ProjectId=10000
&TenantId=10001
&ApiNameKeyword=我的API名称
&ApiPathKeyword=/test/
&CreatorId=12345
&公共请求参数

正常返回示例

XML格式

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

<ListDataServicePublishedApisResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>0000-ABCD-EFG****</RequestId>
    <ErrorMessage>The connection does not exist.</ErrorMessage>
    <Success>true</Success>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Data>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
        <TotalCount>100</TotalCount>
        <Apis>
            <Timeout>10000</Timeout>
            <Status>1</Status>
            <ApiId>10002</ApiId>
            <ApiMode>0</ApiMode>
            <ProjectId>10000</ProjectId>
            <ResponseContentType>0</ResponseContentType>
            <CreatorId>1234567</CreatorId>
            <VisibleRange>0</VisibleRange>
            <ModifiedTime>2020-06-23T00:21:01+0800</ModifiedTime>
            <OperatorId>2345678</OperatorId>
            <GroupId>ab123</GroupId>
            <Description>测试API描述</Description>
            <RequestMethod>0</RequestMethod>
            <CreatedTime>2020-06-23T00:21:01+0800</CreatedTime>
            <ApiName>我的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>fail to call</ErrorMessage>
                    <ErrorCode>1001</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>
        </Apis>
    </Data>
</ListDataServicePublishedApisResponse>

JSON格式

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" : {
    "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" : "测试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" : "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" : 123
        }
      }
    }
  }
}

错误码

HttpCode

错误码

错误信息

描述

429 Throttling.Api The request for this resource has exceeded your available limit. 对该资源的请求已超过您的可用上限。
429 Throttling.System The DataWorks system is busy. Try again later. DataWorks系统繁忙,请稍后再试。
429 Throttling.User Your request is too frequent. Try again later. 您的请求过于频繁,请尝试放缓请求速度。
500 InternalError.System An internal system error occurred. Try again later. 系统内部错误,请稍后再试。
500 InternalError.UserId.Missing An internal system error occurred. Try again later. 系统内部错误,请稍后再试。

访问错误中心查看更多错误码。