调用UpdateDataServiceApi更新数据服务API开发态的信息。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String UpdateDataServiceApi

要执行的操作。

ApiDescription String 测试API描述

API的描述信息。

ApiId Long 10000

API的ID。

ApiPath String /test/2

API的路径。

ProjectId Long 10001

工作空间的ID。

Protocols String 0,1

API协议,可选枚举值包括0(HTTP)和1(HTTPS)。支持多值,多个值之间使用英文逗号(,)分隔。

RegionId String cn-shanghai

地域ID。

RequestMethod Integer 0

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

ResponseContentType Integer 0

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

TenantId Long 10001

租户ID。

Timeout Integer 10000

超时时间,单位为毫秒(ms),取值范围为

(0, 30000]。 )
VisibleRange Integer 0

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

WizardDetails String {"isPagedResponse":true,"wizardConnection":{"connectionId":122786,"tableName":"person"},"wizardRequestParameters":[{"columnName":"id","defaultValue":"","exampleValue":"1","isRequiredParameter":true,"parameterDataType":2,"parameterDescription":"","parameterName":"id","parameterOperator":0,"parameterPosition":0}],"wizardResponseParameters":[{"columnName":"id","exampleValue":"11","parameterDataType":2,"parameterDescription":"","parameterName":"id"}]}

向导API的详情,请参见GetDataServiceApi接口wizardDetails字段的JSON String。

ScriptDetails String {"isPagedResponse":false,"script":"select id as id1, name as name1 from person where id=${inputid}","scriptConnection":{"connectionId":122786,"tableName":"person"},"scriptRequestParameters":[{"defaultValue":"","exampleValue":"","isRequiredParameter":true,"parameterDataType":0,"parameterDescription":"","parameterName":"inputid","parameterOperator":0,"parameterPosition":1}],"scriptResponseParameters":[{"exampleValue":"","parameterDataType":0,"parameterDescription":"","parameterName":"id1"},{"exampleValue":"","parameterDataType":0,"parameterDescription":"","parameterName":"name1"}]}

脚本API的详情,请参见GetDataServiceApi接口scriptDetails字段的JSON String。

RegistrationDetails String {"failedResultSample":"fail","registrationErrorCodes":[{"errorCode":"e1","errorMessage":"msg1","errorSolution":"sol1"},{"errorCode":"e2","errorMessage":"msg2","errorSolution":"sol2"}],"registrationRequestParameters":[{"columnName":"","defaultValue":"","exampleValue":"","isRequiredParameter":true,"parameterDataType":0,"parameterDescription":"","parameterName":"id","parameterOperator":0,"parameterPosition":1},{"columnName":"","defaultValue":"xx","exampleValue":"","isRequiredParameter":true,"parameterDataType":0,"parameterDescription":"","parameterName":"cc","parameterOperator":2,"parameterPosition":2}],"serviceContentType":1,"serviceHost":"http://www.baidu.com","servicePath":"/[uid]","serviceRequestBodyDescription":"body","successfulResultSample":"success"}

注册API的详情,请参见GetDataServiceApi接口registrationDetails字段的JSON String。

返回数据

名称 类型 示例值 描述
Data Boolean true

更新API是否成功。

ErrorCode String Invalid.Tenant.ConnectionNotExists

错误码。

ErrorMessage String The connection does not exist.

错误信息。

HttpStatusCode Integer 200

HTTP状态码。

RequestId String 0000-ABCD-EFG****

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

Success Boolean true

调用是否成功。

示例

请求示例

http(s)://[Endpoint]/?Action=UpdateDataServiceApi
&ApiDescription=测试API描述
&ApiId=10000
&ApiPath=/test/2
&ProjectId=10001
&Protocols=0,1
&RegionId=cn-shanghai
&RequestMethod=0
&ResponseContentType=0
&TenantId=10001
&Timeout=10000
&VisibleRange=0
&<公共请求参数>

正常返回示例

XML 格式

<RequestId>0000-ABCD-EFG****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>true</Data>
<Success>true</Success>

JSON 格式

{
    "RequestId": "0000-ABCD-EFG****",
    "HttpStatusCode": 200,
    "Data": true,
    "Success": true
}

错误码

HttpCode 错误码 错误信息 描述
403 Forbidden.Access Access is forbidden. Activate DataWorks first. 您被限制访问,请开通DataWorks企业版或旗舰版。
500 InternalError.System An internal system error occurred. Try again later. 系统内部错误,请稍后再试。
500 InternalError.UserId.Missing An internal system error occurred. Try again later. 系统内部错误,请稍后再试。
403 ResourceNotAuthorized.Api You are not authorized to access the resources. 您无法访问未取得授权的资源。
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. 您的请求过于频繁,请尝试放缓请求速度。

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