API Key Custom Role
The custom roles an API key is given. The key holds every permission of the role except those with the Owned scope: a key owns nothing.
API Key Custom Role 模型
屬性
-
- 名稱
_id- 類型
- Object ID
- 說明
-
ID of this object
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions
-
- 名稱
createdAt- 類型
- Date
- 說明
-
Date and Time when the object was created.
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions
-
- 名稱
updatedAt- 類型
- Date
- 說明
-
Date and Time when the object was updated.
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions
-
- 名稱
project- 類型
- Project
- 說明
-
Relation to Project Resource in which this object belongs
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
projectId- 類型
- Object ID 必填
- 說明
-
ID of your OneUptime Project in which this object belongs
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
apiKey- 類型
- API Key
- 說明
-
The API key given the role.
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
apiKeyId- 類型
- Object ID 必填
- 說明
-
ID of the API key given the role.
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
customRole- 類型
- Custom Role
- 說明
-
The custom role given to the API key.
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
customRoleId- 類型
- Object ID 必填
- 說明
-
ID of the custom role given to the API key.
-
建立: ProjectOwner 或 ProjectAdmin 或 EditProjectApiKeyPermissions讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
createdByUser- 類型
- User
- 說明
-
Relation to User who created this object (if this object was created by a User)
-
建立: 自動產生讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
-
- 名稱
createdByUserId- 類型
- Object ID
- 說明
-
User ID who created this object (if this object was created by a User)
-
建立: 自動產生讀取: ProjectOwner 或 ProjectAdmin 或 ReadProjectApiKey更新: 無法更新
/api/api-key-custom-role/get-list
列表
此端點允許您擷取所有 API Key Custom Role 的分頁列表。預設情況下,每頁最多顯示十個 API Key Custom Role。
可選查詢參數
-
- Limit
limit- 類型
- number
- 說明
- 要取得的物件數量。預設為 10,您可以將此數量增加到 100
-
- Skip
skip- 類型
- number
- 說明
- 要跳過的物件數量。這在分頁時非常有用
可選請求內文
-
- Query
query- 類型
- query
- 說明
- 如果您想對 API Key Custom Role 進行過濾。您可以在此處指定查詢。有關更多資訊, 請查看此處的查詢撰寫說明。
-
- Select
select- 類型
- select
- 說明
- 預設情況下,您只會擷取物件的 ID,要擷取更多欄位,您需要選擇它們。有關更多資訊, 請查看此處的選擇方法。
-
- Sort
sort- 類型
- sort
- 說明
- 物件將預設按建立日期排序。您可以透過傳遞以下內容來變更排序順序 請查看此處的選擇方法。
列表請求
POST/api/api-key-custom-role/get-list?skip=0&limit=10
Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"apiKeyId": true,
"customRoleId": true,
"projectId": true,
"apiKey": true,
"createdByUser": true
},
"query": {},
"sort": {
"createdAt": -1
}
}
回應
{
"count": 10,
"limit": 10,
"skip": 0,
"data": [
{
"_id": "d2273950-393d-47b5-a585-d6b12d11ae9c",
"apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
"apiKey": "Production API Key",
"createdByUser": "admin@company.com"
},
{
"_id": "e1d1c1f9-c414-46f0-bff8-7e7a548d76c7",
"apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
"apiKey": "Production API Key",
"createdByUser": "admin@company.com"
},
{
"_id": "cf76f930-0d37-40ad-8a92-cab64205ff66",
"apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
"apiKey": "Production API Key",
"createdByUser": "admin@company.com"
}
]
}
/api/api-key-custom-role/:id/get-item
透過 ID 取得項目
此端點允許您透過 ID 擷取 API Key Custom Role。
必需查詢參數
-
- ID
id- 類型
- text
- 說明
- 物件的 ID
可選請求內文
-
- Select
select- 類型
- select
- 說明
- 預設情況下,您只會擷取物件的 ID,要擷取更多欄位,您需要選擇它們。有關更多資訊, 請查看此處的選擇方法。
取得項目請求
POST/api/api-key-custom-role/:id/get-item
Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"apiKeyId": true,
"customRoleId": true,
"projectId": true,
"apiKey": true,
"createdByUser": true
}
}
回應
{
"_id": "d2273950-393d-47b5-a585-d6b12d11ae9c",
"apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
"apiKey": "Production API Key",
"createdByUser": "admin@company.com"
}
/api/api-key-custom-role/count
計數
此端點允許您擷取所有 API Key Custom Role 的計數。
可選請求內文
-
- Query
query- 類型
- query
- 說明
- 如果您想對 API Key Custom Role 進行過濾。您可以在此處指定查詢。有關更多資訊, 請查看此處的查詢撰寫說明。
計數請求
POST/api/api-key-custom-role/count
Content-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {}
}
回應
{
"count": 107
}
/api/api-key-custom-role
建立 API Key Custom Role
此端點允許您建立一個新物件。
請求內文
-
- Data
data- 類型
- JSON
- 說明
- 要建立的 JSON 格式物件
建立請求
POST/api/api-key-custom-role
Content-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
"apiKey": "Production API Key",
"customRole": "Incident Responder"
}
}
回應
{
"_id": "d2273950-393d-47b5-a585-d6b12d11ae9c",
"apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
"apiKey": "Production API Key",
"createdByUser": "admin@company.com"
}
/api/api-key-custom-role/:id
透過 ID 更新
此端點允許您透過 ID 更新物件。
請求內文
-
- Data
data- 類型
- JSON
- 說明
- 要更新的 JSON 格式物件
替代方法
對於不支援 PUT 請求的用戶端,您可以使用 POST 或 GET 並使用相同的請求標頭和內文:
/api/api-key-custom-role/:id/update-item
更新請求
PUT/api/api-key-custom-role/:id
Content-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {}
}
回應
{}
/api/api-key-custom-role/:id
透過 ID 刪除
此端點允許您透過 ID 刪除物件。
替代方法
對於不支援 DELETE 請求的用戶端,您可以使用 POST 或 GET 並使用相同的請求標頭和內文:
/api/api-key-custom-role/:id/delete-item
刪除請求
DELETE/api/api-key-custom-role/:id
Content-Type: application/json ApiKey: YOUR_API_KEY
回應
{}
權限
您的 API 權杖需要權限才能建立、更新、讀取或刪除此資源。如果您沒有權限發起請求,將回傳 4xx 狀態作為回應。
讀取權限
讀取 API Key Custom Role 所需
-
ProjectOwner- Project Owner
- Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
-
ProjectAdmin- Project Admin
- Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
-
ReadProjectApiKey- Read API Key
- This permission can read api keys of this project.
建立權限
建立 API Key Custom Role 所需
-
ProjectOwner- Project Owner
- Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
-
ProjectAdmin- Project Admin
- Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
-
EditProjectApiKeyPermissions- Edit API Key Permissions
- This permission can edit api key permissions of this project.
更新權限
更新 API Key Custom Role 所需
-
ProjectOwner- Project Owner
- Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
-
ProjectAdmin- Project Admin
- Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
-
EditProjectApiKeyPermissions- Edit API Key Permissions
- This permission can edit api key permissions of this project.
刪除權限
刪除 API Key Custom Role 所需
-
ProjectOwner- Project Owner
- Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
-
ProjectAdmin- Project Admin
- Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
-
DeleteProjectApiKey- Delete API Key
- This permission can delete api keys of this project.
-
EditProjectApiKeyPermissions- Edit API Key Permissions
- This permission can edit api key permissions of this project.