Call UpdateDataServiceApi updating the data service API development state of information.

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 Required UpdateDataServiceApi

The operation that you want to perform.

ApiDescription String Required Test API description

The description of the API operation.

ApiId Long Yes 10000

The ID of the API to query.

ApiPath String Required /test/2

The path to the API.

ProjectId Long Yes 10001

The ID of the DataWorks workspace.

Protocols String Required 0,1

The protocol used by the API. You can select 0(HTTP) and 1(HTTPS) for enumeration. Multiple values are supported, and multiple values are separated by a comma (,).

RegionId String Required cn-shanghai

The ID of the region where your project resides.

RequestMethod Integer Yes 0

The API request method. You can select 0(GET), 1(POST), 2(PUT), or 3(DELTE). The Wizard and script APIs support GET and POST. The registration API supports GET, POST, PUT, and DELETE.

ResponseContentType Integer Yes 0

The type of the data to be returned for the API. Valid values: 0(JSON) and 1(XML). JSON is supported for Wizard and script APIs, and JSON and XML are supported for registration APIs.

TenantId Long Yes 10001

The ID of the tenant.

Timeout Integer Yes 10000

The timeout value. Unit: milliseconds (ms). Valid values: 0 to 30000. )

VisibleRange Integer Yes 0

Visible range. Optional enumeration values include 0 (workspace) and 1 (private).

WizardDetails String No {"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"}]}

For more information about the wizard API, see the JSON String in the wizardDetails field of the GetDataServiceApi API.

ScriptDetails String No {"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"}]}

For more information about the script API, see the JSON String in scriptDetails GetDataServiceApi.

RegistrationDetails String No {"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"}

For more information about how to register an API, see the JSON String of GetDataServiceApi API registrationDetails.

Response parameters

Parameter Type Example Description
Data Boolean true

Indicates whether the update operation was successful.

ErrorCode String 0

The error code.

ErrorMessage String Valid

The returned message.

HttpStatusCode Integer 200

The HTTP status code.

RequestId String 0000-ABCD-EFG****

The unique ID of the request.

Success Boolean true

Indicates whether the call is successful.

Examples

Sample requests

http(s)://[Endpoint]/? Action=UpdateDataServiceApi
&ApiDescription=Test API description
&ApiId=10000
&ApiPath=/test/2
&ProjectId=10001
&Protocols=0,1
&RegionId=cn-shanghai
&RequestMethod=0
&ResponseContentType=0
&TenantId=10001
&Timeout=10000
&VisibleRange=0
&<Common request parameters>

Sample success responses

XML format

<RequestId>0000-ABCD-EFG****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>true</Data>
<ErrorCode>0</ErrorCode>
<ErrorMessage> normal </ErrorMessage>
<Success>true</Success>

JSON format

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

Error code

HttpCode Error code Error message Description
403 Forbidden.Access Access is forbidden. Activate DataWorks first. Your access is restricted, possibly because you have not activated DataWorks.
500 InternalError.System An internal system error occurred. Try again later. An internal system error occurred. Please try again later.
500 InternalError.UserId.Missing An internal system error occurred. Try again later. An internal system error occurred. Please try again later.
403 ResourceNotAuthorized.Api You are not authorized to access the resources. You cannot access resources without authorization.
429 Throttling.Api The request for this resource has exceeded your available limit. The request for the resource exceeds your available upper limit.
429 Throttling.System The DataWorks system is busy. Try again later. DataWorks the system is busy, please try again later.
429 Throttling.User Your request is too frequent. Try again later. Your request is too frequent, please try to slow down the request speed.

For a list of error codes, visit the API Error Center.