Interface DifyServerClient
public interface DifyServerClient
Dify Server Client Interface
Provides methods to interact with Dify's server API for managing applications,
API keys, authentication, and related operations.
- Since:
- 2025/4/9 10:14
- Version:
- 0.8.0
- Author:
- yanghq
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves detailed information about a specific applicationRetrieves a list of applications based on mode and name filtergetAppApiKey(String appId) Retrieves existing API keys for a specific applicationRetrieves existing API keys for datasetsinitAppApiKey(String appId) Initializes or regenerates API keys for a specific applicationInitializes or regenerates API keys for datasetslogin()Authenticates with the Dify server and returns login credentialsrefreshToken(String refreshToken) Refreshes an authentication token to maintain session validity
-
Method Details
-
apps
Retrieves a list of applications based on mode and name filter- Parameters:
mode- The application mode to filter by (e.g., "completion", "chat")name- The application name to search for- Returns:
- List of application responses matching the criteria
-
app
Retrieves detailed information about a specific application- Parameters:
appId- The ID of the application to retrieve- Returns:
- The application response containing detailed information
-
getAppApiKey
Retrieves existing API keys for a specific application- Parameters:
appId- The ID of the application to get API keys for- Returns:
- List of API key responses associated with the application
-
initAppApiKey
Initializes or regenerates API keys for a specific application- Parameters:
appId- The ID of the application to initialize API keys for- Returns:
- List of newly generated API key responses
-
getDatasetApiKey
List<DatasetApiKeyResponse> getDatasetApiKey()Retrieves existing API keys for datasets- Returns:
- List of dataset API key responses
-
initDatasetApiKey
List<DatasetApiKeyResponse> initDatasetApiKey()Initializes or regenerates API keys for datasets- Returns:
- List of newly generated dataset API key responses
-
login
LoginResponse login()Authenticates with the Dify server and returns login credentials- Returns:
- Login response containing access token and refresh token
-
refreshToken
Refreshes an authentication token to maintain session validity- Parameters:
refreshToken- The refresh token used to obtain a new access token- Returns:
- Login response containing new access token and refresh token
-