UserRestriction

Represents a restriction on a user.

  • เส้นทางแหล่งข้อมูล
  • /cloud/v2/universes/{universe_id}/user-restrictions
  • /cloud/v2/universes/{universe_id}/places/{place_id}/user-restrictions

คุณลักษณะ

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
เอาต์พุตเท่านั้น

The timestamp when the user restriction was last updated. สตริงนี้มีรูปแบบประทับเวลา

userstring
เอาต์พุตเท่านั้น

The affected user.

gameJoinRestrictionobject

The user is banned from the parent universe or place.

URL หลัก

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

List User Restrictions
เวอร์ชัน 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.

ขอบเขต
universe.user-restriction:read
คำขอพารามิเตอร์เส้นทาง
universe_idstring
จำเป็นต้องมี

The universe ID.

พารามิเตอร์คิวรี
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".

การตอบกลับ

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}'
การตอบกลับ

{
"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
เวอร์ชัน Beta

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

Get the user restriction.

ขอบเขต
universe.user-restriction:read
คำขอพารามิเตอร์เส้นทาง
universe_idstring
จำเป็นต้องมี

The universe ID.

user_restriction_idstring
จำเป็นต้องมี

The user-restriction ID.

การตอบกลับUserRestriction
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

Update User Restriction
เวอร์ชัน Beta

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

Update the user restriction.

ขอบเขต
universe.user-restriction:write
คำขอพารามิเตอร์เส้นทาง
universe_idstring
จำเป็นต้องมี

The universe ID.

user_restriction_idstring
จำเป็นต้องมี

The user-restriction ID.

พารามิเตอร์คิวรี
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. สตริงนี้มีรูปแบบ FieldMask

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. สตริงนี้มีรูปแบบประทับเวลา

เนื้อหาคำขอUserRestriction
การตอบกลับ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

List User Restriction Logs
เวอร์ชัน 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.

ขอบเขต
universe.user-restriction:read
คำขอพารามิเตอร์เส้นทาง
universe_idstring
จำเป็นต้องมี

The universe ID.

พารามิเตอร์คิวรี
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'".

การตอบกลับ

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}'
การตอบกลับ

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