This topic describes how to view, delete, move, and clone APIs, perform batch operations, and search API code.
View an API
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, select the desired workspace from the drop-down list and click Go to DataService Studio.
On the Service Development page, expand the folder where the target API is located.
Right-click the name of the API and select Details.
NoteYou can right-click an API and select Details only if the API is published. If the API is not published, you can click Properties in the right-side pane of the API configuration page to view its basic information.
Clone an API
You can create a copy of an API and save it to a specified path in the directory tree.
On the Service Development page, expand the folder where the target API is located.
Right-click the name of the API and select Clone.
In the Clone API dialog box, configure the parameters.

Parameter
Description
API Name
The name can contain Chinese characters, letters, digits, and underscores (_). It must start with a Chinese character or a letter. The name must be 4 to 50 characters in length.
API Path
The path where the API is stored, such as /user.
The API path can contain letters, digits, underscores (_), and hyphens (-). It must start with a forward slash (/) and be no more than 200 characters in length.
Description
Add a description for the cloned API.
Destination Folder
The folder where the API is stored.
Click Confirm.
Delete an API
You can delete only unpublished APIs. If an API is published, you must unpublish it before you can delete it.
Unpublish the API if it is published. This step is optional.
If your API is not published, you can skip this step.
On the Service Development page, click Service Management in the top menu bar. The API Management page appears by default.

On the Published APIs tab, click Unpublish in the Management column for the API.
After the API is unpublished, click Service Development in the top menu bar to return to the Service Development page.
On the Service Development page, expand the folder where the target API is located.
Right-click the API that you want to delete and select Delete.
ImportantThis operation cannot be undone. To ensure data security, proceed with caution.
Mobile API
You can move only unpublished APIs. If an API is published, you must unpublish it before you can move it.
Unpublish the API if it is published. This step is optional.
If your API is not published, you can skip this step.
On the Service Development page, click Service Management in the top menu bar. The API Management page appears by default.

On the Published APIs tab, click Unpublish in the Management column for the API.
After the API is unpublished, click Service Development in the top menu bar to return to the Service Development page.
On the Service Development page, expand the folder where the target API is located.
Right-click the API that you want to move and select Move.
In the Modify File Path dialog box, select a Destination Folder and click Confirm to move the API.
- Important
Moving an API may change the group to which the API belongs. This affects the invocation URL of the API after it is published. Therefore, move published APIs with caution.
Batch operations for APIs
DataWorks supports batch operations for APIs, such as modifying service resource groups, submitting APIs, and publishing APIs. This feature lets you quickly switch resource groups for multiple APIs and republish them.
On the Service Development page, click the
icon at the top of the directory tree on the left to open the batch operations page.
At the top of the batch operations page, you can filter APIs by conditions such as Business Flow and Owner.
From the filtered list, select the APIs on which you want to perform batch operations.
After selecting the APIs, choose a batch operation from the bottom of the page to apply to them.
The following describes the relationship between batch operations and API statuses:
Batch operation
Unpublished & Unsubmitted
Unpublished & Submitted
Published & Unsubmitted
Published & Submitted
Modify service resource group




Submit

You cannot submit the API again. Go to the API editing page and discard the previously submitted version in Version Control on the right.

You cannot submit the API again. Go to the API editing page and discard the previously submitted version in Version Control on the right.
Publish
An API must be submitted before it can be published. For an unsubmitted API, submit it before you publish it.

An API must be submitted before it can be published. For an unsubmitted API, submit it before you publish it.
NoteAfter you modify the service resource group for a published API, you must test, submit, and publish the API again for the changes to take effect.
Search for APIs by code
You can search for code within APIs that were created in the code editor of the current workspace.
In the navigation pane on the left, click the
icon to open the code search page.
Click the
icon to the right of the search box to expand the filter conditions.You can enter keywords in the search box, such as an API name, API path, API description, table name, or field name. You can also filter the search results by conditions such as owner, business flow, and modification time.
View the search results.
The results that match the search conditions are displayed below the search box. The results include the following information:
NoteOnly published APIs are displayed.
API name: Click an API name to open the configuration page for that API in the right-side pane.
Code content: Displays the matched keyword, its line number, and a brief context. You can copy the matched code content.
Basic information: Displays the API ID, owner, business flow, and last modification time.