*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡

UserRestriction

代表對使用者的限制。

  • 資源路徑
  • /cloud/v2/universes/{universe_id}/user-restrictions
  • /cloud/v2/universes/{universe_id}/places/{place_id}/user-restrictions

特性

pathstring

使用者限制的資源路徑。

格式:

  • universes/{universe_id}/user-restrictions/{user_restriction_id}
  • universes/{universe_id}/places/{place_id}/user-restrictions/{user_restriction_id}.
updateTimestring
僅限輸出

使用者限制最後更新時間戳。. 此字串的格式為 Timestamp

userstring
僅限輸出

受影響的使用者。.

gameJoinRestrictionobject

使用者被禁止進入父宇宙或地點。.

基本網址

https://apis.roblox.com
UserRestriction資源

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

列出使用者限制
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions

列出已在宇宙或特定地點被禁止的使用者限制。

範圍
universe.user-restriction:read
請求路徑參數
universe_idstring
需要

宇宙ID。.

查詢參數
maxPageSizenumber

要返回的使用者限制最大數量。服務可能會返回少於此值。如果未指定,最多返回 10 個使用者限制。最大值為 100,高於 100 的值設為 100。.

pageTokenstring

從以前的呼叫中收到的頁面代幣,用於取回後續頁面。

當頁面分頁時,所有其他參數提供給後續呼叫的頁面代幣必須與提供頁面代幣的呼叫匹配。.

回應

父集合中的使用者限制清單。

userRestrictionsarray<UserRestriction>

指定宇宙或地點的使用限制。.

nextPageTokenstring

您可以將其作為pageToken參數發送到回收下一頁的代幣。如果此欄位被忽略,就沒有後續頁面。.

GET /cloud/v2/universes/{universe_id}/user-restrictions

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions?maxPageSize=10&pageToken={string}' \
-H 'x-api-key: {your-api-key}'
回應

{
"userRestrictions": [
{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}
],
"nextPageToken": "string"
}

UserRestriction

取得使用者限制
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

取得使用者限制。

範圍
universe.user-restriction:read
請求路徑參數
universe_idstring
需要

宇宙ID。.

user_restriction_idstring
需要

使用者限制ID。.

GET /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}' \
-H 'x-api-key: {your-api-key}'
回應

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

更新使用者限制
Beta

PATCH /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

更新使用者限制。

範圍
universe.user-restriction:write
請求路徑參數
universe_idstring
需要

宇宙ID。.

user_restriction_idstring
需要

使用者限制ID。.

查詢參數
updateMaskstring

要更新的字段列表。

game_join_restriction 字段必須被原子更新;索引到 game_join_restriction (例如 "game_join_restriction.active" ) 的字段面罩不支持。. 此字串的格式為 FieldMask

idempotencyKey.keystring

用於無效性的獨特鑰匙。.

idempotencyKey.firstSentstring

第一次請求發送的時戳。

如果此事件發生在 idempotency 鑰匙的有效期之後,而且超過了標示的最低有效期,服務器必須返回錯誤。. 此字串的格式為 Timestamp

請求主體UserRestriction
PATCH /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

curl -L -X PATCH 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}?updateMask={string}&idempotencyKey.key={string}&idempotencyKey.firstSent={string}' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"gameJoinRestriction": {
"active": true,
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true
}
}'
回應

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

列出使用者限制紀錄
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions:listLogs

列出給定宇宙內使用者限制資源的變更。這包括宇宙級和地點級限制。

對於宇宙等級限制日誌,place欄位將為空。

範圍
universe.user-restriction:read
請求路徑參數
universe_idstring
需要

宇宙ID。.

查詢參數
maxPageSizenumber

要返回的使用者限制紀錄最大數量。服務可能會返回少於此值。如果未指定,最多返回 10 個使用者限制記錄。最大值為 100,高於 100 的值設為 100。.

pageTokenstring

從以前的呼叫中收到的頁面代幣,用於取回後續頁面。

當頁面分頁時,所有其他參數提供給後續呼叫的頁面代幣必須與提供頁面代幣的呼叫匹配。.

filterstring

此欄位可設為過濾返回的日誌。

filter 欄位支持非常少數的 CEL:

  • user
  • place
  • 比較操作 == 已可用。
  • 也支持 && 邏輯運作者。

舉例來說,過濾用戶和地點的形式為 filter="user == 'users/123'" && "place == 'places/456'".

回應

返回應用於使用者限制資源的變更紀錄清單。

logsarray<object>

指定宇宙的使用限制日誌。.

nextPageTokenstring

您可以將其作為pageToken參數發送到回收下一頁的代幣。如果此欄位被忽略,就沒有後續頁面。.

GET /cloud/v2/universes/{universe_id}/user-restrictions:listLogs

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions:listLogs?maxPageSize=10&pageToken={string}&filter={string}' \
-H 'x-api-key: {your-api-key}'
回應

{
"logs": [
{
"user": "users/156",
"place": "places/456",
"moderator": {
"robloxUser": "users/156"
},
"createTime": "2023-07-05T12:34:56Z",
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"restrictionType": {
"gameJoinRestriction": {}
},
"excludeAltAccounts": true
}
],
"nextPageToken": "string"
}