Querying a Pre-Shared Key
Description
This API is used to query a pre-shared key, including its status and remarks. The pre-shared key is returned to the user only when it is created for the first time. No other APIs can be used to obtain the pre-shared key. Keep the pre-shared key file obtained during creation secure.
URL
GET https://ip: port/AIVAULT/v1/queryPSK
Request Header
Parameter |
Type |
Description |
DomainID |
UInt |
Key domain ID, which indicates the domain of an organization, an application, or a model. The value ranges from 1 to 500. |
- Parameters in this request header are set by users.
- Domain IDs are used to differentiate applications or models. A maximum of 500 domains are supported.
Request Parameters
Parameter |
Mandatory/Optional |
Type |
Description |
PSKName |
Optional |
String |
If PSKname is not carried in a request, all pre-shared keys are queried. The value contains 1 to 128 characters, allowing only digits, letters, underscores (_), and hyphens (-). |
SortBy |
Optional |
String |
The value can be CreateTime or PSKName. |
SortMode |
Optional |
String |
The value can be asc or desc (default). (The sorting is performed by time in descending order.) |
BindMKName |
Optional |
String |
Name of the bound master key. The value contains 1 to 128 characters, allowing only digits, letters, underscores (_), and hyphens (-). |
Request Example
https://ip:port/AIVAULT/v1/queryPSK?PSKName=test
Response Description
Level-1 Parameter |
Level-2 Parameter |
Type |
Description |
status |
\ |
String |
Error code |
msg |
\ |
String |
Error message |
data |
\ |
Object |
Packet list, which may contain multiple records. |
\ |
PSKName |
String |
Name of the pre-shared key, which must be unique. |
\ |
PSKBindMKName |
String |
Name of the master key bound to the pre-shared key |
\ |
PSKCreateTime |
String |
Time when the pre-shared key is created |
\ |
PSKRemarks |
String |
Remarks |
Response Example
{
"status": "00000000",
"msg": "ok",
"data": [
{
"PSKName": "test",
"PSKRemarks": "test",
"PSKCreateTime": "2022-06-15T14:40:22.753669124+08:00",
"PSKBindMKName": "test"
}
]
}
For details about the error codes, see Error Codes.
For details about the status codes, see Status Codes.