This document introduces the overall process for calling OpenAPI, interface call limitations, and common error codes, with a focus on the essential token application and usage methods required when calling OpenAPI.
Authorization: Bearer jwt_token.x-request-id and request-id (ensure the string is unique) to the request headers. Two headers are needed because DataAgent consists of multiple components, and different components may use different identifiers. These two parameters will be recorded in DataAgent's backend logs, helping you analyze and locate issues more efficiently, thereby enabling faster resolution of potential faults.The overall process is as follows:
ClientId and ClientSecret. The credential types are divided into two categories: user and system (only supported for system administrators).ClientId and ClientSecret you received.warning
Be sure to properly keep ClientId and ClientSecret confidential. These are credentials for calling the interface. Disclosing them to other users will result in a risk of data leakage.
Request URL: The interface URL varies depending on the environment.
# Replace the clientId and clientSecret curl --location --request POST 'https://console.volcengine.com/aeolus/api/v3/openapi/jwtToken' \ -H 'Content-Type: application/json' \ -d '{ "metadata": { "clientId": "{clientId}", "clientSecret": "{clientSecret}", "proxyUser": "abc****@21**********", "expire": 3600 } }'
tip
If the user has opened the "Developer Console" - "Credential Management" page, they can directly copy the relevant request parameters provided below the credential. Only the obtained clientId and clientSecret need to be replaced. The system has already filled in the proxyUser and expire parameters for them.
Name | Type | Required | Example value | Description |
|---|---|---|---|---|
clientId | integer | Required | 123abc | Login credential ID, obtained in the previous step |
clientSecret | integer | Required | 123abc | Login credential key, obtained in the previous step |
proxyUser | string | Optional | user_1 | The username corresponding to the token. tip This username is only valid for system-type credentials. |
expire | integer | Optional | 3600 | Token expiration time. The default value is 3600, in seconds. warning The maximum token expiration time is 3 days, that is, 259200 seconds |
Parameter | Type | Description |
|---|---|---|
code | string | Return status code. If the request is successful, aeolus/ok is returned. The following are error codes and their explanations:
|
data | object | Contains specific information returned by the interface. This includes jwtToken and proxyUser. |
data.jwtToken | string | Represents the user's identity information. When calling business interfaces, the user needs to include jwtToken in the request header. |
data.proxyUser | string | The username corresponding to the token |
msg | string | A natural language description of the operation result |
{ "code": "aeolus/ok", "data": { "jwtToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.ey*****************************************************************************************************************************************************************************.********************-*************************************************************************************-****************************************************************************************************************************-***-********************************************-******************************************************-*************************-****************************************************************************-************-*************************************-*********************************************************************************************************************************************************-****************-******************5sus", "proxyUser": "user_1" }, "msg": "成功" //which means "success" }
When calling the interface, the user needs to include the content of jwtToken in the request header, for example: Authorization: Bearer jwt_token
The following is an example of calling the interface for the current user using curl:
curl -X GET 'https://{domain}/aeolus/api/v3/open/misc/current_user' \ -H 'Authorization: Bearer jwt_token'
tip
To ensure service stability and prevent malicious attacks, the DataAgent backend uses the following methods to limit requests:
(1) Rate limiting (the current interface's external service capacity has reached a high level; if it still does not meet your requirements, you can contact the Volcano Engine technical support team to request modifications);
(2) Blocking, used to reserve some APIs as not open or to temporarily block abnormal user requests;
(3) Auditing, every openapi call will be recorded, including the caller, interface, parameters, and call time.
For details, see Reference: Common Error Codes.