通過 OpenAPI 更改程式碼群組成員的許可權。
服務存取點與授權資訊
產品 | 資源 | 要求的權限 |
代碼管理 | 成員 | 讀寫 |
請求文法
Region版
PUT https://{domain}/oapi/v1/codeup/groups/{groupId}/members/{userId}要求標頭
參數 | 類型 | 是否必填 | 描述 | 樣本值 |
x-yunxiao-token | string | 是 | 個人存取權杖。 | pt-0fh3****0fbG_35af****0484 |
請求參數
參數 | 類型 | 位置 | 是否必填 | 描述 | 樣本值 |
groupId | string | path | 是 | 程式碼群組 ID 或者 URL-Encoder 編碼的全路徑。 | 2813489或者60de7a6852743a5162b5f957%2FDemoGroup |
userId | string | path | 是 | 雲效使用者識別碼。 | 62c795xxxb468af8 |
accessLevel | integer | query | 是 | 存取權限:20-瀏覽者,30-開發人員,40-庫管理員。 | 30 |
expiresAt | string | query | 否 | 到期時間,固定時間格式:yyyy-MM-dd。 | 2024-10-05 |
請求樣本
Region版
curl -X 'PUT' \
'https://{domain}/oapi/v1/codeup/groups/2813489或者60de7a6852743a5162b5f957%2FDemoGroup/members/62c795xxxb468af8?accessLevel=30&expiresAt=2024-10-05' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'返回參數
參數 | 類型 | 描述 | 樣本值 |
| - | object | ||
accessLevel | integer | 成員許可權:20-瀏覽者,30-開發人員,40-管理員。 | 30 |
avatarUrl | string | 頭像地址。 | https://example/example/w/100/h/100 |
expiresAt | string | 到期時間。 | 2024-10-05T15:30:45Z |
id | integer | 主鍵 ID(無實際業務意義)。 | 2813489 |
| inheritedGroup | object | 繼承許可權來源的程式碼群組;成員直接加在當前程式碼群組上且無繼承情境時為 null。僅在各子 property 上維護 example;勿在本對象根寫 example,否則 Nezha gen api-doc 返回樣本中該對象會為空白 {}。 | |
avatarUrl | string | 頭像地址。 | https://example/example/w/100/h/100 |
fullPath | string | 空間完整路徑。 | 60de7a6852743a5162b5f957/parent-group |
id | integer | ID。 | 1 |
kind | string | 類型,一般為 group。 | group |
name | string | 名稱。 | ParentGroup |
nameWithNamespace | string | 完整名稱。 | 60de7a6852743a5162b5f957 / ParentGroup |
parentId | integer | 上級路徑的 ID。 | 2 |
path | string | 路徑。 | parent-group |
pathWithNamespace | string | 完整路徑。 | 60de7a6852743a5162b5f957/parent-group |
visibility | string | 可見度;繼承情境下可能為空白,可能的值:[private internal public]。 | private |
webUrl | string | 頁面訪問時的 URL。 | https://example.com/60de7a6852743a5162b5f957/parent-group |
memberType | string | 成員類型:USERS 為使用者;TEAMS 為部門(此時請使用 teamId)。 | USERS |
name | string | 成員名稱。 | codeup-demo |
state | string | 狀態:active-已啟用, blocked-阻塞,暫無法使用。 | active |
teamId | string | 部門成員時的部門 id(與入參 teamId 一致);非部門成員時為 null。 | 70d8ddd4-xxxx-xxxx-xxxx-46100efe985e |
userId | string | 雲效使用者識別碼(在 Codeup 提交的 OpenAPI 中涉及到使用者識別碼 之處,均應該使用該使用者識別碼)。 | 62c795xxxb468af8 |
username | string | 使用者名稱稱。 | codeup-username |
webUrl | string | 頁面存取 URL。 | xxx |
返回樣本
{
"accessLevel": 30,
"avatarUrl": "https://example/example/w/100/h/100",
"expiresAt": "2024-10-05T15:30:45Z",
"id": 2813489,
"inheritedGroup": {
"avatarUrl": "https://example/example/w/100/h/100",
"fullPath": "60de7a6852743a5162b5f957/parent-group",
"id": 1,
"kind": "group",
"name": "ParentGroup",
"nameWithNamespace": "60de7a6852743a5162b5f957 / ParentGroup",
"parentId": 2,
"path": "parent-group",
"pathWithNamespace": "60de7a6852743a5162b5f957/parent-group",
"visibility": "private",
"webUrl": "https://example.com/60de7a6852743a5162b5f957/parent-group"
},
"memberType": "USERS",
"name": "codeup-demo",
"state": "active",
"teamId": "70d8ddd4-xxxx-xxxx-xxxx-46100efe985e",
"userId": "62c795xxxb468af8",
"username": "codeup-username",
"webUrl": "xxx"
}錯誤碼
訪問錯誤碼中心查看 API 相關錯誤碼。