更新訪客空間的訪客
- 如果不使用空間功能或禁用訪客空間功能,則會發生錯誤。
- 在運行此 API 之前,請在
要添加來賓使用者的 API 中添加來賓使用者。
https://sample.cybozu.com/k/guest/GUEST_SPACE_ID
/v1/space/guests.json
PUT
參數
參數名稱 |
型 |
必須 |
說明 |
id |
數位或字串 |
必須 |
要更新訪客成員的訪客空間的空間ID |
guests |
陣列(字串) |
必須 |
訪客成員所屬的登錄名(電子郵件地址)陣列 如果指定的使用者不是kintone的Guest使用者、暫停使用者或已刪除的使用者,則會發生錯誤。 |
示例請求
頁眉
1
2
3
4
|
{
"X-Cybozu-Authorization": "QWRtaW5pc3RyYXRvcjpjeWJvenU=",
"Content-Type": "application/json"
}
|
關於請求頭,請參見
kintone REST API的通用規範 。
身體
1
2
3
4
|
{
"id": "1",
"guests": ["guest1@example.com", "guest2@example.com", "guest3@example.com"]
}
|
使用 curl 的請求
1
2
3
4
5
6
7
8
9
10
11
|
curl -X PUT 'https://sample.cybozu.com/k/guest/3/v1/space/guests.json' \
-H 'X-Cybozu-Authorization: QWRtaW5pc3RyYXRvcjpjeWJvenU=' \
-H 'Content-Type: application/json' \
-d '{
"id": 1,
"guests": [
"guest1@example.com",
"guest2@example.com",
"guest3@example.com"
]
}'
|
發送kintone REST API請求 使用API發送請求
1
2
3
4
5
6
7
8
9
10
|
const body = {
id: 1,
guests: [
'guest1@example.com',
'guest2@example.com',
'guest3@example.com'
]
};
await kintone.api(kintone.api.url('/k/guest/1/v1/space/guests.json', false), 'PUT', body);
|