调用GetDataServicePublishedApi查询数据服务API的发布态信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| ProjectId | long | 是 | 工作空间的 ID。 | 10002 | 
| TenantId | long | 否 | 租户 ID。您可登录 DataWorks 控制台,进入数据开发(DataStudio)页面,单击右上方当前登录用户名称,选择菜单 > 用户信息,获取租户 ID。 | 10003 | 
| ApiId | long | 是 | API 的 ID。 | 10001 | 
返回参数
不同类型 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 | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 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. | 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. | 系统内部错误,请稍后再试。 | 
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|---|---|
| 2023-10-10 | OpenAPI 错误码发生变更 | 查看变更详情 | 
