Register an API
Registering an API adds an existing service to the service platform for centralized management. This topic describes how to register an API.
Step 1: Select the API creation method
On the Dataphin homepage, choose Service > API Development.
In the upper-left corner, select a service project. In the left-side navigation pane, click API Service. On the API page, click + Create API.
In the Create API dialog box, select Register API.
Step 2: Configure the API parameters
On the Create API page, configure parameters.
Parameter
Description
API basic information
API name
The API name must meet the following requirements:
Can contain only Chinese characters, letters, digits, and underscores (_).
Must be 4 to 100 characters in length.
Must start with a letter.
Must be globally unique.
Operation type
The operation type of the API. Valid values include:
GET: Retrieves a specific resource from the server.
LIST: Retrieves a portion of the resources from the server.
Data update frequency
Specifies the update frequency of the API response data to inform callers of its freshness. Supported values are Daily, Hourly, Minutly, and Custom. If you select Custom, you can enter a string of up to 128 characters.
API group
Select an API group that is configured in the current project. To create one, see Create a Service Group.
Description
A brief description of the API, up to 128 characters.
Protocol
The protocol for the API. Supported protocols are HTTP and HTTPS.
HTTP: Hypertext Transfer Protocol, one of the most widely used network protocols.
HTTPS: You can select HTTPS if the gateway is configured as an Alibaba Cloud API Gateway (dedicated or shared instance). To prevent call failures, ensure that the SSL certificate for the independent domain name is valid. To configure the SSL certificate, select Platform Management Network Configuration and make the changes on the Network Configuration page.
Timeout
The maximum duration for an API call. The default is 3 seconds, and the valid range is an integer from 3 to 60.
If an API call exceeds the configured timeout, an error is reported. To view exceptions, see Manage and Monitor APIs.
Version
The API version. Each configuration is assigned a version for version control and comparison. The version must be unique within the API and up to 64 characters long.
Return type
The default value is JSON.
Backend service configuration
Mode
Supported modes: Basic or Dev_Prod.
In Basic mode, all operations (development, submission, and publishing) read from the production database.
In Dev-Prod mode, development and submission operations read from the development database, while the publishing operation reads from the production database.
Request method
The request method for calling the backend service. Supported values are POST and GET.
POST: If you select POST, request parameters can be placed in the request body.
GET: If you select GET, request parameters cannot be placed in the request body.
API data source
Select the API data source for the registered API. To create one, see Create an API Data Source.
Service timeout
The maximum duration for a call to the backend service. If a call to the backend service exceeds the configured service timeout, the API call fails with a backend timeout error. To view exceptions, see Manage and Monitor APIs.
Service path
The request path for the backend service. It must start with a forward slash (/) and be no more than 128 characters long.
For example, if the URL of the API data source is
http://88.100.19.58:*****/api/exampleand the service path is/abc/djd, then the complete URL for the backend service ishttp://88.100.19.58:*****/api/example/abc/djd.Request parameters
Parameter name
The public-facing name of the parameter used in API calls. The name can be up to 128 characters long.
Parameter location
The location of the parameter in the request. Supported locations are Headers, Parameters, and Body.
Headers: The parameter is added to the request header.
Parameters: The parameter is appended to the data source URL as a query parameter.
Body: If multiple parameters exist, they are encapsulated into a single request body.
Parameter type
If the parameter location is Headers or Parameters, supported parameter types include DOUBLE, FLOAT, STRING, DATE(yyyy-MM-dd HH:mm:ss), BOOLEAN, INT, LONG, SHORT, and BIGDECIMAL. You must select the parameter type that corresponds to the bound field.
If the parameter location is Body, the following types are also supported in addition to the types listed above: Array(int), Array(string), Object, Array(double), Array(float), Array(Date(yyyy-MM-dd HH:mm:ss)), Array(boolean), Array(long), Array(short), Array(BigDecimal), and Array(Object).
Default value
This value is used if a caller does not provide one. The value can be up to 1,000 characters long. If the parameter type is STRING, there is no character limit.
Example
An example value to guide developers. The value can be up to 1,000 characters long.
Description
A brief description of the request parameter. The description can be up to 1,000 characters long.
Required
If a required parameter is not provided when the API is called, the API call fails.
Test
Test the API to verify that it returns the expected response.
After you configure the request parameters, click Test. In the Send Test Request dialog box, enter test values for the request parameters and click Start Test. The system encapsulates the parameters, sends the request, and returns the response.
Smart Add
This option is available for GET APIs after a test has been run. Click Smart Add to automatically populate the response parameters based on the test response. The extracted information includes the parameter name, response parameter path, and parameter type.
Response parameters
Parameter name
Required. The name of the parameter as it appears in the API response. The name can be up to 128 characters long.
Response parameter path
Only JSON format is supported. If the response data is nested, you must configure the path for the response parameter. Click View Configuration Instructions to see examples, or enter keywords to search for matching paths.

Parameter type
If the response parameter path has been tested, the system detects the data type based on the test result. You can then select the type that matches the field bound to the parameter name. Supported types include DOUBLE, FLOAT, STRING, DATE(yyyy-MM-dd HH:mm:ss), BOOLEAN, INT, LONG, SHORT, BIGDECIMAL, Array(int), Array(string), Object, Array(double), Array(float), Array(Date(yyyy-MM-dd HH:mm:ss)), Array(boolean), Array(long), Array(short), Array(BigDecimal), and Array(Object).
Example
An example value to guide developers. The value can be up to 1,000 characters long.
Description
A brief description of the response parameter. The description can be up to 1,000 characters long.
Click Submit to create the API.
Next steps
After creating the API, test and publish it to the data service marketplace to make it callable by applications. For more information, see Test and Publish an API.
To delete the API, manage its versions, or transfer ownership, see Manage APIs.