ListUserSSHKeys - Query SSH Key List for a Specific User
Queries the SSH key list for a specific user.
|
Applicable editions |
Central edition, Region edition |
Service Endpoints and Authorization Information
- Obtain service endpoints: Replace {domain} in the API request syntax.
- Obtain a personal access token.
- Obtain organizationId: Required only for Central edition. Go to the Basic Information page in the Organization Management console to retrieve the organization ID.
|
Product |
Resource |
Required Permissions |
|
Code Management |
SSH Key |
Read-only |
Request Syntax
Central edition
GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/users/{userId}/keys
Region edition
GET https://{domain}/oapi/v1/codeup/users/{userId}/keys
Request Headers
|
Parameter |
Type |
Required |
Description |
Example Value |
|
x-yunxiao-token |
string |
Yes |
Personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request Parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example Value |
|
organizationId |
string |
path |
|
Organization ID. |
60d54f3daccf2bbd6659f3ad |
|
userId |
string |
path |
Yes |
User ID. |
60d54f3ddbbd661659f3ad |
|
page |
integer |
query |
No |
Page number. Default value: 1. Maximum value: 150. |
1 |
|
perPage |
integer |
query |
No |
Number of entries per page. Default value: 20. Valid values: 1 to 100. |
20 |
|
orderBy |
string |
query |
No |
Sorting field. Valid values: created_at (default), updated_at. |
created_at |
|
sort |
string |
query |
No |
Sorting order. Valid values: asc, desc (default). |
desc |
Request Examples
Central edition
curl -X 'GET' \
'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/users/60d54f3ddbbd661659f3ad/keys?page=1&perPage=20&orderBy=created_at&sort=desc' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Region edition
curl -X 'GET' \
'https://{domain}/oapi/v1/codeup/users/60d54f3ddbbd661659f3ad/keys?page=1&perPage=20&orderBy=created_at&sort=desc' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response Parameters
|
Parameter |
Type |
Description |
Example Value |
| - |
object |
|
|
| createdAt |
string |
Creation time. |
2024-10-05T15:30:45Z |
| expireTime |
string |
Expiration time. |
2024-10-05T15:30:45Z |
| fingerPrint |
string |
Device fingerprint. |
xxx |
| id |
integer |
ID of the SSH key. |
1 |
| key |
string |
Public key content. |
xxx |
| keyScope |
string |
Scope of the SSH key. Valid values: ALL (read and write, including clone, pull, and push), READ (read-only, supports only clone and pull). |
ALL |
| lastUsedTime |
string |
Last used time. |
2024-10-05T15:30:45Z |
| title |
string |
Title of the SSH key. |
username@example |
| updatedAt |
string |
Update time. |
2024-10-05T15:30:45Z |
Response Examples
{
"createdAt": "2024-10-05T15:30:45Z",
"expireTime": "2024-10-05T15:30:45Z",
"fingerPrint": "xxx",
"id": 1,
"key": "xxx",
"keyScope": "ALL",
"lastUsedTime": "2024-10-05T15:30:45Z",
"title": "username@example",
"updatedAt": "2024-10-05T15:30:45Z"
}
Response Headers
|
Parameter |
Description |
Example Value |
|
x-next-page |
Next page number. |
3 |
|
x-page |
Current page number. |
2 |
|
x-per-page |
Number of entries per page. |
20 |
|
x-prev-page |
Previous page number. |
1 |
|
x-request-id |
Request ID. |
37294673-00CA-5B8B-914F-A8B35511E90A |
|
x-total |
Total number of entries. |
50 |
|
x-total-pages |
Total number of pages. |
3 |
Error Codes
For more information, see the Error Code Center.