Register an existing HTTP or HTTPS API into DataService Studio to centrally publish and manage it — monitor call logs, control versions, and organize APIs with labels.
If you need to build an API from scratch instead of registering an existing one, see Generate an API in the codeless UI.
Prerequisites
Before you begin, ensure that you have:
-
A business process created in DataService Studio (required to select a destination folder)
-
An existing backend HTTP or HTTPS service with a known host URL and path
Register an API
-
On the Service Development page, click the
icon and choose New API > Register API. Alternatively, open a business process, right-click API, and choose New API > Register API. -
In the Register API dialog box, configure the following parameters.
Parameter Description Destination Folder The folder where the API is stored. Click the field to select a folder. If no folder is available, create a business process first. API name A custom name for the API. The name must be unique within both the API gateway group and the workspace. API path The path that identifies this API in the gateway. For example, /user.Protocol The supported protocols are HTTP and HTTPS. To call the API over HTTPS, publish the API to the gateway, then bind an independent domain name in the API Gateway console and upload an SSL certificate. For details, see Support HTTPS. Request method The supported methods are GET, POST, PUT, and DELETE. Return type The supported formats are JSON and XML. Visible scope Controls who can see the API in the directory tree. Workspace: visible to all workspace members. Private: visible only to you; permissions cannot be granted to other members. Label Select labels from the Label list to organize and filter the API. Description A brief description of the API. Maximum 2,000 characters. 
Configure the API
Double-click the registered API to open its configuration page, then complete the following sections in order.
Define the backend service
In the Define Backend Service section, specify where DataService Studio should forward incoming requests.
| Parameter | Description |
|---|---|
| Backend service host | The host of your backend service. Must start with http:// or https:// and must not include a path. For example, for the backend URL http://xxx-cn-xxx.alicloudapi.com/user/info, set the host to http://xxx-cn-xxx.alicloudapi.com. |
| Backend service path | The path of your backend service. For example, for the backend URL http://xxx-cn-xxx.alicloudapi.com/user/info, set the path to /user/info. The path can include parameters in brackets, such as /user/[userid]. Parameters defined in the path are automatically added to the request parameter list in the next step. |
| Backend timeout | The timeout period for the backend service. |
Define request parameters
In the Define Request Parameters section, configure the inputs that API callers pass when calling this API.
| Parameter | Description |
|---|---|
| Request parameters | Click Add Parameter to define the request parameters. For each parameter, set Parameter Position to QUERY, HEAD, PATH, or BODY. Available positions depend on the selected request method. |
| Constant parameters | Parameters with fixed values that are hidden from API callers. The backend always receives these parameters, but callers do not need to pass them. Use this to fix a parameter value and hide it from callers. |
| Request body definition | Available only when the request method is POST or PUT. Enter a JSON or XML example of the request body as a reference for API callers. |
Define response content
In the Define Response Content section, enter a Normal Response Example and an Error Response Example. These examples help API callers write code to parse the response.
Define error codes
In the Define Error Codes section, enter the Error Code, Error Message, and Solution for each possible error. This helps API callers diagnose and resolve call failures.
Save the API
Click the
icon in the toolbar to save the API configuration.
What's next
Test and publish the API:
-
Test the API. For details, see Test an API.
-
After the test passes, click Submit in the upper-right corner.
-
In the right navigation pane of the configuration page, click Version. Find the version to publish and click Request to Publish.
-
On the request page, the request type defaults to Publish Data Service API. Enter a Reason and click Request Permission.
If an approval process is configured for the workspace, the API must be approved before it can be published. For details, see Overview of Approval Center.
-
After the API is published, the service resource group configuration is applied to API calls.
Manage the API:
Clone, delete, or move the API from the directory tree on the Service Development page. To view details of a published API, go to the Service Management page and expand the API list. For more management operations, see View, delete, move, and clone an API, perform batch operations, and search for code in APIs.