UserRestriction

Represents a restriction on a user.

  • ĐƯỜNG DẪN TÀI NGUYÊN
  • /cloud/v2/universes/{universe_id}/user-restrictions
  • /cloud/v2/universes/{universe_id}/places/{place_id}/user-restrictions

Thuộc Tính

pathstring

The resource path of the user restriction.

Formats:

  • universes/{universe_id}/user-restrictions/{user_restriction_id}
  • universes/{universe_id}/places/{place_id}/user-restrictions/{user_restriction_id}.
updateTimestring
Chỉ Xuất

The timestamp when the user restriction was last updated. Chuỗi này được định dạng là Dấu thời gian.

userstring
Chỉ Xuất

The affected user.

gameJoinRestrictionobject

The user is banned from the parent universe or place.

URL Cơ Sở

https://apis.roblox.com
Tài nguyên 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

List User Restrictions
Bản Beta

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

List user restrictions for users that have ever been banned in either a universe or a specific place.

Phạm Vi
universe.user-restriction:read
Yêu CầuTham Số Đường Dẫn
universe_idstring
Bắt Buộc

The universe ID.

Tham Số Truy Vấn
maxPageSizenumber

The maximum number of user restrictions to return. The service might return fewer than this value. If unspecified, at most 10 user restrictions are returned. The maximum value is 100 and higher values are set to 100.

pageTokenstring

A page token, received from a previous call, to retrieve a subsequent page.

When paginating, all other parameters provided to the subsequent call must match the call that provided the page token.

filterstring

This field may be set in order to filter the resources returned.

The filter field supports a very small subset of CEL:

  • Only the game_join_restriction.active field is supported.
  • Only the == operator is available; no other operators nor built-ins are supported.

Example filter: game_join_restriction.active == "true".

Phản Hồi

A list of UserRestrictions in the parent collection.

userRestrictionsarray<UserRestriction>

The UserRestrictions from the specified Universe or Place.

nextPageTokenstring

A token that you can send as a pageToken parameter to retrieve the next page. If this field is omitted, there are no subsequent pages.

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}&filter={string}' \
-H 'x-api-key: {your-api-key}'
Phản Hồi

{
"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

Get User Restriction
Bản Beta

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

Get the user restriction.

Phạm Vi
universe.user-restriction:read
Yêu CầuTham Số Đường Dẫn
universe_idstring
Bắt Buộc

The universe ID.

user_restriction_idstring
Bắt Buộc

The user-restriction ID.

Phản HồiUserRestriction
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}'
Phản Hồi

{
"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

Update User Restriction
Bản Beta

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

Update the user restriction.

Phạm Vi
universe.user-restriction:write
Yêu CầuTham Số Đường Dẫn
universe_idstring
Bắt Buộc

The universe ID.

user_restriction_idstring
Bắt Buộc

The user-restriction ID.

Tham Số Truy Vấn
updateMaskstring

The list of fields to update.

The game_join_restriction field must be updated atomically; field masks that index into game_join_restriction (such as "game_join_restriction.active") are not supported. Chuỗi này được định dạng là Mặt nạ trường.

idempotencyKey.keystring

The unique key to use for idempotency.

idempotencyKey.firstSentstring

The timestamp at which the first request was sent.

If this is further in the past than the lifetime of the idempotency key (which may exceed the annotated minimum lifetime), the server must return an error. Chuỗi này được định dạng là Dấu thời gian.

Yêu Cầu Cơ ThểUserRestriction
Phản HồiUserRestriction
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
}
}'
Phản Hồi

{
"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

List User Restriction Logs
Bản Beta

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

List changes to UserRestriction resources within a given universe. This includes both universe-level and place-level restrictions.

For universe-level restriction logs, the place field will be empty.

Phạm Vi
universe.user-restriction:read
Yêu CầuTham Số Đường Dẫn
universe_idstring
Bắt Buộc

The universe ID.

Tham Số Truy Vấn
maxPageSizenumber

The maximum number of UserRestrictionLogs to return. The service may return fewer than this value. If unspecified, at most 10 UserRestrictionLogs are returned. The maximum value is 100 and higher values are set to 100.

pageTokenstring

A page token, received from a previous call, to retrieve a subsequent page.

When paginating, all other parameters provided to the subsequent call must match the call that provided the page token.

filterstring

This field may be set to filter the logs returned.

The filter field supports a very small number of CEL:

  • user
  • place
  • The == comparison operator is available.
  • The && logical operator is also supported.

As an example, filtering for a user and a place takes the form filter="user == 'users/123'" && "place == 'places/456'".

Phản Hồi

Returns a list of change logs applied to UserRestriction resources.

logsarray<object>

The UserRestrictionLogs from the specified Universe.

nextPageTokenstring

A token that you can send as a pageToken parameter to retrieve the next page. If this field is omitted, there are no subsequent pages.

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}'
Phản Hồi

{
"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"
}