Application management and API permission binding

Updated at:

You can use natural language commands with code agents like Qoder and CodeX to create data service applications, manage members, discover published APIs, verify authorization results, and obtain application credentials. This topic describes the features of this capability, its prerequisites, usage examples, and expected results. An appendix provides a list of input information for your reference.

Overview

The data service application management and API permission binding capability allows you to use natural language commands to manage the entire lifecycle of a data service application, from creation to credential retrieval. This prepares you to call authorized APIs by using an AppKey and AppSecret. A typical workflow includes creating an application, adding members, discovering published APIs in a project, verifying authorization results, and obtaining application credentials.

Use cases:

  • Create a caller application for a data service project and obtain the AppKey and AppSecret for API calls.

  • Add members to an application to manage its access permissions.

  • Query published APIs within a project, or look up the specific APIs and fields that an application is authorized to access.

  • Reset an application's AppSecret if it is compromised or has expired.

Note

Limitations: Granting API authorization to an application and revoking API authorization are not currently supported through public APIs. This is because the field identifiers required for authorization must be obtained from the Data Service > Application > API Authorization page in the Dataphin console. However, creating applications, managing members, querying published APIs, verifying authorization results, retrieving credentials, and performing secret resets are fully supported and can be completed through natural language commands.

Prerequisites

  • The target data service project exists, and the current user is a member of the project.

  • To grant API authorization to an application, at least one API in the project must be published to the production environment.

  • You must know the application group to which the application will belong. Application groups and data service projects are separate concepts. When you create an application, you must specify an application group. The code agent typically queries available application groups for you to choose from.

Examples

Here are some example commands you can use directly:

  • "Create an application named order-service-app in the data service project to call the order query API."

  • "Add user zhangsan as a member to this data service application."

  • "Find out which data service APIs are published in this project."

  • "Check which APIs and fields this application is currently authorized to access."

  • "The AppSecret for this application needs to be reset. Give me the new secret after you reset it."

Interaction steps:

  1. The code agent typically starts by confirming key information such as the target tenant, data service project, and application name. If any information is missing, it will prompt you for it.

  2. Before creating an application, the code agent usually queries the available application groups and asks you to confirm the application's group before creating it.

  3. After the application is successfully created, the code agent returns the AppKey and AppSecret and prompts you to save them in a secure location.

  4. If you need to grant API authorization to the application, the code agent will explain that this operation must currently be completed in the Dataphin console. It can assist by querying published APIs and then verifying the authorization results after you complete the process.

  5. Before performing an irreversible operation such as a secret reset, the code agent will usually ask you to confirm that all callers have been notified before proceeding.

Results

After the operation is complete, you will receive the following results:

  • Returned content: After an application is successfully created, the Application ID (AppId), AppKey, and AppSecret are returned. Query operations return a list of applications, published APIs, or details of authorized APIs and fields.

  • Completion status: After a write request is accepted, changes to the application, members, or secret take effect. API authorization must be completed in the console, after which the code agent can verify the result.

  • Viewing and verification: You can sign in to the Dataphin console and go to the Application page of the data service project to view application information, members, authorized APIs, and credential status.

Note

The AppSecret is returned only once when the application is created or the secret is reset. You must save it immediately, as it cannot be retrieved later. A secret reset is an irreversible operation. After the reset, the old secret becomes invalid immediately, and all calls using the old secret will be rejected. A success message from the command line only indicates that the request has been accepted. Always refer to the Dataphin console for the definitive status.

Appendix: Input information

The following table lists information that might be required when you manage data service applications and bind API permissions. This table is for reference only. In practice, the code agent automatically identifies the required information from your commands and prompts you for any missing details. Information items marked as not required are generated by the system, so you do not need to provide them.

Parameter

Required

Description

Example

Tenant ID

Yes

The ID of the target Dataphin tenant.

1234567890123456789

Data service project

Yes

The project that contains the application. It is used to query published APIs and the application list.

—

Application group

Yes

Required when creating an application. This is a separate concept from a data service project. The code agent usually queries available groups for you to choose from.

—

Application name

Yes

The name you specify for the application.

order-service-app

Application ID

No

A system-generated ID returned after application creation. It is used for subsequent operations such as member management, credential queries, and secret resets.

System-generated

AppKey

No

The application's public identifier, returned after creation. It is used to uniquely identify the application and verify its authorizations.

System-generated

AppSecret

No

The secret credential for an application. It is returned only once upon creation or reset and must be stored securely.

—

Member

No

The user to add as an application member.

zhangsan

API identifier

No

The identifier for the API to be authorized or verified. Obtain this from the list of published APIs in the console.

—