GetDataServiceApi
Retrieves development details for a Data Service API.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TenantId |
integer |
No |
The tenant ID. |
10002 |
| ProjectId |
integer |
Yes |
The workspace ID. You can obtain the ID from the PageResult.ProjectList[].ProjectId field in the response of the ListProjects operation. |
10001 |
| ApiId |
integer |
Yes |
The ID of the data service API. You can obtain the ID from the Data.Apis[].ApiId field in the response of the ListDataServiceApis operation. |
10000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| RequestId |
string |
The request ID. |
0000-ABCD-EFG**** |
| ErrorMessage |
string |
The error message. |
The specified parameters are invalid. |
| Success |
boolean |
Indicates whether the call was successful. |
true |
| ErrorCode |
string |
The error code. |
1031203110005 |
| Data |
object |
The returned data. |
|
| Timeout |
integer |
The timeout period, in milliseconds. |
10000 |
| Status |
integer |
The status of the API. Valid values:
|
0 |
| ApiId |
integer |
The ID of the data service API. |
10000 |
| ApiMode |
integer |
The type of the API. Valid values:
|
0 |
| ProjectId |
integer |
The ID of the workspace. |
10001 |
| ResponseContentType |
integer |
The response data type of the API. Valid values:
|
0 |
| CreatorId |
string |
The Alibaba Cloud ID of the creator. |
1234567 |
| VisibleRange |
integer |
The visibility scope. Valid values:
|
0 |
| ModifiedTime |
string |
The last modified time. The format is |
2020-06-23T00:21:01+0800 |
| OperatorId |
string |
The Alibaba Cloud ID of the last editor. |
2345678 |
| GroupId |
string |
The group ID. |
ab123**** |
| Description |
string |
The description. |
Test API description |
| FolderId |
integer |
The folder ID. |
0 |
| RequestMethod |
integer |
The request method of the API. Valid values:
|
0 |
| CreatedTime |
string |
The creation time. The format is |
2020-06-23T00:21:01+0800 |
| ApiName |
string |
The name of the API. |
Test API name |
| TenantId |
integer |
The tenant ID. |
10002 |
| ApiPath |
string |
The path of the API. |
/test/1 |
| Protocols |
array |
The list of protocols. |
|
|
integer |
The API protocol. This is a multi-value list. Valid values:
|
0 |
|
| RegistrationDetails |
object |
The details of the registered API. This parameter is returned only for registered APIs. |
|
| ServiceHost |
string |
The backend service address. |
http://example.aliyundoc.com |
| ServiceContentType |
integer |
The response data type of the API. Valid values:
|
0 |
| ServicePath |
string |
The backend service path. |
/index |
| SuccessfulResultSample |
string |
The sample success response. |
{"success": true} |
| FailedResultSample |
string |
The sample error response. |
{"success": false} |
| ServiceRequestBodyDescription |
string |
The description of the backend request body. |
{"abc":1} |
| RegistrationErrorCodes |
array<object> |
The list of error codes for the registered API. |
|
|
object |
The returned object. |
||
| ErrorMessage |
string |
The error message. |
fail to call |
| ErrorCode |
string |
The error code. |
1001 |
| ErrorSolution |
string |
The solution to the error. |
retry |
| RegistrationRequestParameters |
array<object> |
The list of request parameters for the registered API. |
|
|
object |
The returned object. |
||
| ColumnName |
string |
The name of the bound table field. This parameter is supported only in wizard mode. |
column1 |
| ParameterName |
string |
The name of the parameter. |
name1 |
| ParameterPosition |
integer |
The position of the parameter. Valid values:
|
0 |
| ParameterDescription |
string |
The description. |
description1 |
| DefaultValue |
string |
The default value. |
default1 |
| ParameterOperator |
integer |
The operator. Valid values:
|
0 |
| ParameterDataType |
integer |
The data type. Valid values:
|
0 |
| ExampleValue |
string |
The example value. |
example1 |
| IsRequiredParameter |
boolean |
Specifies whether the parameter is required. |
true |
| ScriptDetails |
object |
The details of the script API. This parameter is returned only for script APIs. |
|
| Script |
string |
The SQL script. |
select a from t |
| IsPagedResponse |
boolean |
Indicates whether the response is paginated. |
true |
| ScriptRequestParameters |
array<object> |
The list of request parameters for the script API. |
|
|
object |
The returned object. |
||
| ColumnName |
string |
The name of the bound table field. This parameter is supported only in wizard mode. |
column1 |
| ParameterName |
string |
The name of the parameter. |
param1 |
| ParameterPosition |
integer |
The position of the parameter. Valid values:
|
0 |
| ParameterDescription |
string |
The description. |
description1 |
| DefaultValue |
string |
The default value. |
default1 |
| ParameterOperator |
integer |
The operator. Valid values:
|
0 |
| ParameterDataType |
integer |
The data type. Valid values:
|
0 |
| ExampleValue |
string |
The example value. |
example1 |
| IsRequiredParameter |
boolean |
Specifies whether the parameter is required. |
true |
| ScriptResponseParameters |
array<object> |
The list of response parameters for the script API. |
|
|
object |
The returned object. |
||
| ParameterDescription |
string |
The description. |
description2 |
| ColumnName |
string |
The name of the bound table field. This parameter is supported only in wizard mode. |
column2 |
| ParameterName |
string |
The name of the parameter. |
param2 |
| ParameterDataType |
integer |
The data type. Valid values:
|
0 |
| ExampleValue |
string |
The example value. |
example2 |
| ScriptConnection |
object |
The data source information of the script API. |
|
| TableName |
string |
The name of the data source table. |
t |
| ConnectionId |
integer |
The ID of the data source. |
123 |
| WizardDetails |
object |
The details of the wizard API. This parameter is returned only for wizard APIs. |
|
| IsPagedResponse |
boolean |
Indicates whether the response is paginated. |
true |
| WizardRequestParameters |
array<object> |
The list of request parameters for the wizard API. |
|
|
object |
The returned object. |
||
| ColumnName |
string |
The name of the bound table field. This parameter is supported only in wizard mode. |
column1 |
| ParameterName |
string |
The name of the parameter. |
param1 |
| ParameterPosition |
integer |
The position of the parameter. Valid values:
|
0 |
| ParameterDescription |
string |
The description. |
description1 |
| DefaultValue |
string |
The default value. |
default1 |
| ParameterOperator |
integer |
The operator. Valid values:
|
0 |
| ParameterDataType |
integer |
The data type. Valid values:
|
0 |
| ExampleValue |
string |
The example value. |
example1 |
| IsRequiredParameter |
boolean |
Specifies whether the parameter is required. |
true |
| WizardResponseParameters |
array<object> |
The list of response parameters in wizard mode. |
|
|
object |
The returned object. |
||
| ParameterDescription |
string |
The description. |
description2 |
| ColumnName |
string |
The name of the bound table field. This parameter is supported only in wizard mode. |
column2 |
| ParameterName |
string |
The name of the parameter. |
param2 |
| ParameterDataType |
integer |
The data type. Valid values:
|
0 |
| ExampleValue |
string |
The example value. |
example2 |
| WizardConnection |
object |
The data source information of the wizard API. |
|
| TableName |
string |
The table name of the data source. |
t |
| ConnectionId |
integer |
The ID of the data source. |
123 |
| ApigwVersion |
integer |
The gateway version. Valid values: 1: API Gateway. 2: Cloud-native API gateway. |
1 |
| CloudNativeApiGwAuthType |
integer |
The security authentication method of the cloud-native API gateway. Valid values: 1: No authentication. 2: ApiKey. 3: JWT. 4: HMAC. |
1 |
The details for each API type are returned in a separate field. WizardDetails contains details for wizard APIs, ScriptDetails for script APIs, and RegistrationDetails for registered APIs.
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"RequestId": "0000-ABCD-EFG****",
"ErrorMessage": "The specified parameters are invalid.",
"Success": true,
"ErrorCode": "1031203110005",
"Data": {
"Timeout": 10000,
"Status": 0,
"ApiId": 10000,
"ApiMode": 0,
"ProjectId": 10001,
"ResponseContentType": 0,
"CreatorId": "1234567",
"VisibleRange": 0,
"ModifiedTime": "2020-06-23T00:21:01+0800",
"OperatorId": "2345678",
"GroupId": "ab123****",
"Description": "Test API description",
"FolderId": 0,
"RequestMethod": 0,
"CreatedTime": "2020-06-23T00:21:01+0800",
"ApiName": "Test API name",
"TenantId": 10002,
"ApiPath": "/test/1",
"Protocols": [
0
],
"RegistrationDetails": {
"ServiceHost": "http://example.aliyundoc.com",
"ServiceContentType": 0,
"ServicePath": "/index",
"SuccessfulResultSample": "{\"success\": true}",
"FailedResultSample": "{\"success\": false}",
"ServiceRequestBodyDescription": "{\"abc\":1}",
"RegistrationErrorCodes": [
{
"ErrorMessage": "fail to call",
"ErrorCode": "1001",
"ErrorSolution": "retry"
}
],
"RegistrationRequestParameters": [
{
"ColumnName": "column1",
"ParameterName": "name1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ParameterDataType": 0,
"ExampleValue": "example1",
"IsRequiredParameter": true
}
]
},
"ScriptDetails": {
"Script": "select a from t",
"IsPagedResponse": true,
"ScriptRequestParameters": [
{
"ColumnName": "column1",
"ParameterName": "param1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ParameterDataType": 0,
"ExampleValue": "example1",
"IsRequiredParameter": true
}
],
"ScriptResponseParameters": [
{
"ParameterDescription": "description2",
"ColumnName": "column2",
"ParameterName": "param2",
"ParameterDataType": 0,
"ExampleValue": "example2"
}
],
"ScriptConnection": {
"TableName": "t",
"ConnectionId": 123
}
},
"WizardDetails": {
"IsPagedResponse": true,
"WizardRequestParameters": [
{
"ColumnName": "column1",
"ParameterName": "param1",
"ParameterPosition": 0,
"ParameterDescription": "description1",
"DefaultValue": "default1",
"ParameterOperator": 0,
"ParameterDataType": 0,
"ExampleValue": "example1",
"IsRequiredParameter": true
}
],
"WizardResponseParameters": [
{
"ParameterDescription": "description2",
"ColumnName": "column2",
"ParameterName": "param2",
"ParameterDataType": 0,
"ExampleValue": "example2"
}
],
"WizardConnection": {
"TableName": "t",
"ConnectionId": 123
}
},
"ApigwVersion": 1,
"CloudNativeApiGwAuthType": 1
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError.System | An internal system error occurred. Try again later. | |
| 500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | |
| 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. | |
| 429 | Throttling.User | Your request is too frequent. Try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.