This topic describes how to view, delete, move, and clone APIs, perform batch operations on them, and find them by using code search.
View an API
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to DataService Studio.
On the Service Development page, expand the node.
Right-click the target API and select Details.
NoteThe Details option is available only for published APIs. If an API is not published, you can open its edit page and click Property in the right-side pane to view its basic information.
Clone an API
You can clone an API to a specified path in the directory tree:
On the Service Development page, expand the node.
Right-click the target API and select Cloning.
In the Clone API dialog box, configure the following parameters.
Parameter
Description
API Name
The name must be 4 to 50 characters in length and can contain Chinese characters, letters, digits, and underscores (_). The name must start with a Chinese character or a letter.
APIPath
The path where the API is stored, for example, /user.
The API Path can contain letters, digits, underscores (_), and hyphens (-). It must start with a forward slash (/) and cannot exceed 200 characters in length.
Description
The description of the cloned API.
Location
The directory in which to store the API.
Click Confirm.
Delete an API
In DataService Studio, you can delete only unpublished APIs. To delete a published API, you must first unpublish it:
(Optional) Unpublish the API.
If the API is not published, skip this step.
On the Service Development page, click Service Management at the top to go to the Manage APIs page.
By default, the page displays a list of Published APIs. The Actions column for each API provides buttons such as Unpublish, Authorization, Test, and More.
On the Published APIs tab, find the target API and click Unpublish in the Actions column.
After you unpublish the API, click Service Development at the top of the page to return to the Service Development page.
On the Service Development page, expand the node.
Right-click the API that you want to delete and select Delete.
ImportantThis operation is irreversible. Proceed with caution.
Move an API
In DataService Studio, you can move only unpublished APIs. To move a published API, you must first unpublish it:
(Optional) Unpublish the API.
If the API is not published, skip this step.
On the Service Development page, click Service Management at the top to go to the Manage APIs page.
By default, the page displays a list of Published APIs. The Actions column for each API provides buttons such as Unpublish, Authorization, Test, and More.
On the Published APIs tab, find the target API and click Unpublish in the Actions column.
After you unpublish the API, click Service Development at the top of the page to return to the Service Development page.
On the Service Development page, expand the node.
Right-click the API you want to move and select Move.
In the Move Node dialog box, select the Location and click Confirm.
- Important
Moving an API may change its group, which can affect the endpoint URL after publication. Proceed with caution when moving published APIs.
Batch operations
DataWorks lets you perform batch operations on APIs, such as modifying their DataService Studio resource group, submitting them, and publishing them. This allows you to efficiently switch resource groups and bring the APIs online.
On the Service Development page, click the
icon at the top of the directory tree on the left to go to the batch operation page.At the top of the batch operation page, filter the APIs by criteria such as Workflow and Owner.
In the filtered list, select the checkboxes of the APIs on which you want to perform batch operations.
After selecting the APIs, choose a batch operation from the bottom of the page.
The following table describes the relationship between batch operations and API states.
Batch operation
Unpublished and unsubmitted
Unpublished and submitted
Published and unsubmitted
Published and submitted
Modify Service Resource Group




Submit

You cannot submit an API that has already been submitted. To resubmit the API, go to its edit page, open the Version Management tab in the right-side pane, and discard the previously submitted version.

You cannot submit an API that has already been submitted. To resubmit the API, go to its edit page, open the Version Management tab in the right-side pane, and discard the previously submitted version.
Publish
An API must be submitted before it can be published.

An API must be submitted before it can be published.
NoteAfter you change the resource group for a published API, you must test, submit, and publish the API again for the changes to take effect.
API code search
You can search the code of APIs that are created in script mode within the current workspace.
In the left-side navigation pane, click the
icon to go to the code search page.The left-side pane of the Service Development page contains several function icons, including Code, Table, and Search. The main pane for code search contains the API and Data Push tabs. The search bar allows you to search by ID, name, or API Path. Below the search bar is the collapsible business process section.
Click the
icon to the right of the search box to expand the filter options.You can enter keywords such as an API name, API Path, API description, table name, or field name in the search box to find APIs. You can also filter the search results by criteria such as owner, business process, and modification time.
View the search results.
The results that match your search criteria are displayed below the search bar and include the following information:
NoteSearch results include only published APIs.
API name: Click an API name to open its configuration pane on the right.
Code content: Shows the matched keyword, its line number, and a brief context. You can copy the matched code.
Basic information: Shows the API ID, owner, business process, and last modification time.
icon to the right of the search box to expand the filter options.