Retrieves a list of published APIs.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PageNumber |
integer |
No |
The page number. Pages start from page 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Default is 10, and the maximum is 100. |
10 |
| ProjectId |
integer |
Yes |
The workspace ID. |
10000 |
| TenantId |
integer |
No |
The tenant ID. To obtain the tenant ID, perform the following steps: Log on to the DataWorks console. Find your workspace and go to the DataStudio page. On the DataStudio page, click the logon username in the upper-right corner and click User Info in the Menu section. |
10001 |
| ApiNameKeyword |
string |
No |
The keyword in API names. The keyword is used to search for the APIs whose names contain the keyword. |
My API name |
| ApiPathKeyword |
string |
No |
The keyword in API paths. The keyword is used to search for the APIs whose paths contain the keyword. |
/test/ |
| CreatorId |
string |
No |
The ID of the Alibaba Cloud account used by the creator of the APIs. The ID is used to search for the APIs created by the creator. |
12345 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| RequestId |
string |
The request ID. |
0000-ABCD-EFG**** |
| ErrorMessage |
string |
The error message. |
The connection does not exist. |
| Success |
boolean |
Indicates whether the request was successful. |
true |
| ErrorCode |
string |
The error code. |
Invalid.Tenant.ConnectionNotExists |
| Data |
object |
The data returned. |
|
| PageNumber |
integer |
The page number. The value of this parameter is the same as that of the PageNumber parameter in the request. |
1 |
| PageSize |
integer |
The number of entries per page. Valid values: 1 to 100. Default value: 10. |
10 |
| TotalCount |
integer |
The total number of entries returned. |
100 |
| Apis |
array<object> |
Information about published APIs. |
|
|
array<object> |
|||
| Timeout |
integer |
The timeout period of the API request. Unit: milliseconds. |
10000 |
| Status |
integer |
The status of the API. Valid values: 0 and 1. The value 0 indicates that the API is not published. The value 1 indicates that the API is published. |
1 |
| ApiId |
integer |
The API ID. |
10002 |
| ApiMode |
integer |
The type of the API. Valid values: 0, 1, and 2. The value 0 indicates that the API is generated in wizard mode. The value 1 indicates that the API is generated in script mode. The value 2 indicates that the API is generated by registration. |
0 |
| ProjectId |
integer |
The workspace ID. |
10000 |
| ResponseContentType |
integer |
The format in which the response of the API request is returned. Valid values: 0 and 1. The value 0 indicates the JSON format. The value 1 indicates the XML format. APIs generated in wizard or script mode support the JSON format. APIs generated by registration support the JSON and XML formats. |
0 |
| CreatorId |
string |
The ID of the Alibaba Cloud account used by the creator of the API. |
1234567 |
| VisibleRange |
integer |
The scope in which the API is visible. Valid values: 0 and 1. The value 0 indicates that the API is visible within the workspace. The value 1 indicates that the API is visible only to its owner. |
0 |
| ModifiedTime |
string |
The time when the API was last modified. |
2020-06-23T00:21:01+0800 |
| OperatorId |
string |
The ID of the Alibaba Cloud account used by the user who last modified the API. |
2345678 |
| GroupId |
string |
The group ID. |
ab123 |
| Description |
string |
The description. |
Test API description |
| RequestMethod |
integer |
The request method of the API. Valid values: 0, 1, 2, and 3. The value 0 indicates the GET method. The value 1 indicates the POST method. The value 2 indicates the PUT method. The value 3 indicates the DELETE method. APIs generated in wizard or script mode support the GET and POST methods. APIs generated by registration support the GET, POST, PUT, and DELETE methods. |
0 |
| CreatedTime |
string |
The time when the API was created. |
2020-06-23T00:21:01+0800 |
| ApiName |
string |
The name of the API. |
My API name |
| TenantId |
integer |
The tenant ID. |
10001 |
| ApiPath |
string |
The path of the API. |
/test/1 |
| Protocols |
array |
The protocol used by the API. Valid values: 0 and 1. The value 0 indicates HTTP. The value 1 indicates HTTPS. |
|
|
integer |
The protocol used by the API. Valid values: 0 and 1. The value 0 indicates HTTP. The value 1 indicates HTTPS. |
0 |
|
| RegistrationDetails |
object |
The details of the API generated by registration. This parameter is returned only if the API is generated by registration. |
|
| ServiceHost |
string |
The URL of the backend service. |
http://www.abc.com |
| ServiceContentType |
integer |
The format in which the response of the API request is returned. Valid values: 0 and 1. The value 0 indicates the JSON format. The value 1 indicates the XML format. APIs generated in wizard or script mode support the JSON format. APIs generated by registration support the JSON and XML formats. |
0 |
| ServicePath |
string |
The path of the backend service. |
/index |
| SuccessfulResultSample |
string |
The sample success response of the API. |
{"success": true} |
| FailedResultSample |
string |
The sample error response of the API. |
{"success": false} |
| ServiceRequestBodyDescription |
string |
The description of the request body initiated to call the backend service. |
{"abc":1} |
| RegistrationErrorCodes |
array<object> |
The error codes returned for the API generated by registration. |
|
|
object |
|||
| ErrorMessage |
string |
The error message. |
fail to call |
| ErrorCode |
string |
The error code. |
1001 |
| ErrorSolution |
string |
The solution used to fix the error. |
retry |
| RegistrationRequestParameters |
array<object> |
The request parameters of the API generated by registration. |
|
|
object |
|||
| ParameterName |
string |
The name of the parameter. |
name1 |
| ParameterPosition |
integer |
The position of the parameter. Valid values:
APIs generated in wizard or script mode support only the Query position. APIs generated by registration whose request method is GET or DELETE support the Query and Head positions. APIs generated by registration whose request method is PUT or POST support the Query, Head, and Body positions. |
0 |
| ParameterDescription |
string |
The description. |
description1 |
| DefaultValue |
string |
The default value. |
default1 |
| ParameterOperator |
integer |
The operator used for the value of the parameter. Valid values:
APIs generated in wizard mode support the Equal, Like, and In operators. APIs generated in script mode support the Equal operator. APIs generated by registration support the Equal and Const operators. |
0 |
| ExampleValue |
string |
The sample value. |
example1 |
| ParameterDataType |
integer |
The data type of the parameter. Valid values:
|
0 |
| IsRequiredParameter |
boolean |
Indicates whether the request parameter is required. |
true |
| ScriptDetails |
object |
The details of the API generated in script mode. This parameter is returned only if the API is generated in script mode. |
|
| IsPagedResponse |
boolean |
Indicates whether the entries are returned by page. |
true |
| SuccessfulResultSample |
string |
The sample success response of the API. |
{"success": true} |
| FailedResultSample |
string |
The sample error response of the API. |
{"success": false} |
| Script |
string |
The SQL script. |
select a from t |
| ScriptErrorCodes |
array<object> |
The error codes returned for the API generated in script mode. |
|
|
object |
|||
| ErrorMessage |
string |
The error message. |
fail to call |
| ErrorCode |
string |
The error code. |
1001 |
| ErrorSolution |
string |
The solution used to fix the error. |
retry |
| ScriptRequestParameters |
array<object> |
The request parameters of the API generated in script mode. |
|
|
object |
|||
| ParameterName |
string |
The name of the parameter. |
param1 |
| ParameterPosition |
integer |
The position of the parameter. Valid values:
APIs generated in wizard or script mode support only the Query position. APIs generated by registration whose request method is GET or DELETE support the Query and Head positions. APIs generated by registration whose request method is PUT or POST support the Query, Head, and Body positions. |
0 |
| ParameterDescription |
string |
The description. |
description1 |
| DefaultValue |
string |
The default value. |
default1 |
| ParameterOperator |
integer |
The operator used for the value of the parameter. Valid values:
APIs generated in wizard mode support the Equal, Like, and In operators. APIs generated in script mode support the Equal operator. APIs generated by registration support the Equal and Const operators. |
0 |
| ExampleValue |
string |
The sample value. |
example1 |
| ParameterDataType |
integer |
The data type of the parameter. Valid values:
Advanced scripts also support the following data types:
|
0 |
| IsRequiredParameter |
boolean |
Indicates whether the request parameter is required. |
true |
| ScriptResponseParameters |
array<object> |
The response parameters of the API generated in script mode. |
|
|
object |
|||
| ParameterDescription |
string |
The description. |
description2 |
| ParameterName |
string |
The name of the parameter. |
param2 |
| ExampleValue |
string |
The sample value. |
example2 |
| ParameterDataType |
integer |
The data type of the parameter. Valid values:
|
0 |
| ScriptConnection |
object |
The data source information about the API generated in script mode. |
|
| TableName |
string |
The name of the table in the data source. |
t |
| ConnectionId |
integer |
The data source ID. |
123 |
| WizardDetails |
object |
The details of the API generated in wizard mode. This parameter is returned only if the API is generated in wizard mode. |
|
| IsPagedResponse |
boolean |
Indicates whether the entries are returned by page. |
true |
| SuccessfulResultSample |
string |
The sample success response of the API. |
{"success": true} |
| FailedResultSample |
string |
The sample error response of the API. |
{"success": false} |
| WizardErrorCodes |
array<object> |
The error codes returned for the API generated in wizard mode. |
|
|
object |
|||
| ErrorMessage |
string |
The error message. |
fail to call |
| ErrorCode |
string |
The error code. |
1001 |
| ErrorSolution |
string |
The solution used to fix the error. |
retry |
| WizardRequestParameters |
array<object> |
The request parameters of the API generated in wizard mode. |
|
|
object |
|||
| ParameterName |
string |
The name of the parameter. |
param1 |
| ParameterPosition |
integer |
The position of the parameter. Valid values: 0, 1, 2, and 3. The value 0 indicates that the parameter is in the URL path of the request. The value 1 indicates that the parameter is in the Query parameter of the request URL. The value 2 indicates that the parameter is in the request header. The value 3 indicates that the parameter is in the request body. APIs generated in wizard or script mode support only the Query position. APIs generated by registration whose request method is GET or DELETE support the Query and Head positions. APIs generated by registration whose request method is PUT or POST support the Query, Head, and Body positions. |
0 |
| ParameterDescription |
string |
The description. |
description1 |
| DefaultValue |
string |
The default value. |
default1 |
| ParameterOperator |
integer |
The operator used for the value of the parameter. Valid values: 0, 1, 2, and 3. The value 0 indicates the Equal operator. The value 1 indicates the Like operator. The value 2 indicates the Const operator. The value 3 indicates the In operator. APIs generated in wizard mode support the Equal, Like, and In operators. APIs generated in script mode support the Equal operator. APIs generated by registration support the Equal and Const operators. |
0 |
| ExampleValue |
string |
The sample value. |
example1 |
| ParameterDataType |
integer |
The data type of the parameter. Valid values:
|
0 |
| IsRequiredParameter |
boolean |
Indicates whether the request parameter is required. |
true |
| WizardResponseParameters |
array<object> |
The response parameters of the API generated in wizard mode. |
|
|
object |
|||
| ParameterDescription |
string |
The description. |
description2 |
| ParameterName |
string |
The name of the parameter. |
param2 |
| ExampleValue |
string |
The sample value. |
example2 |
| ParameterDataType |
integer |
The data type of the parameter. Valid values:
|
0 |
| WizardConnection |
object |
The data source information about the API generated in wizard mode. |
|
| TableName |
string |
The name of the table in the data source. |
t |
| ConnectionId |
integer |
The ID of the data source. |
12354 |
| SqlMode |
integer |
SQL mode. 0: Basic SQL; 1: Advanced SQL. |
0 |
The details of different types of APIs are returned in different fields. Wizard APIs use the WizardDetails field, script APIs use the ScriptDetails field, and registration APIs use the RegistrationDetails field.
Examples
Success response
JSON format
{
"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": "Test API description",
"RequestMethod": 0,
"CreatedTime": "2020-06-23T00:21:01+0800",
"ApiName": "My API name",
"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": 12354
}
},
"SqlMode": 0
}
]
}
}
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. | No permission, please authorize |
| 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.