User
rblxopencloud.User(id, api_key)
Bases: Creator
Represents a user on Roblox. It is used to provide information about a user in OAuth2, fetch information about a user, and access their resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
The user's ID. |
required |
api_key |
str
|
The API key created on the Creator Dashboard with access to the user. |
required |
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The user's ID. The |
username |
Optional[str]
|
The user's username, only avalible from OAuth2 with the |
display_name |
Optional[str]
|
The user's display name, only avalible from OAuth2 with the |
profile_uri |
str
|
A URL to the user's profile on Roblox. The |
headshot_uri |
Optional[str]
|
A URI to Roblox's CDN for the user's avatar headshot, only avalible from OAuth2 with the |
created_at |
Optional[datetime]
|
The timestamp the user created their account, only avalible from OAuth2 with the |
upload_asset(file, asset_type, name, description, expected_robux_price=0)
Uploads the file requested file onto roblox as an asset with the provided name and description. The following asset types and file formats are accepted:
Asset Type | File Formats |
---|---|
rblxopencloud.AssetType.Decal |
.png , .jpeg , .bmp , .tga |
rblxopencloud.AssetType.Audio |
.mp3 , .ogg |
rblxopencloud.AssetType.Model |
.fbx |
The asset:read
and asset:write
scopes are required for OAuth2 authorization.
Example
You can upload a file stored on your computer like this:
If the asset is from hosted from a URL on the internet, you could use this:Parameters:
Name | Type | Description | Default |
---|---|---|---|
file |
BytesIO
|
The file opened in bytes to be uploaded. |
required |
asset_type |
Union[AssetType, str]
|
The type of asset you're uploading. |
required |
name |
str
|
The name of your asset. |
required |
description |
str
|
The description of your asset. |
required |
expected_robux_price |
int
|
The amount of robux expected to upload. Fails if lower than actual price. |
0
|
Returns:
Type | Description |
---|---|
Union[Asset, PendingAsset]
|
Returns |
Raises:
Type | Description |
---|---|
InvalidAsset
|
The file is either an unsupported type, uploaded as the wrong |
ModeratedText
|
The name or description was moderated by Roblox's text filter. |
InvalidKey
|
The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
Danger
Avoid uploading assets to Roblox that you don't have full control over, such as AI generated assets or content created by unknown people. Assets uploaded that break Roblox's Terms of Services can get your account moderated.
For OAuth2 developers, it has been confirmed by Roblox staff in this DevForum post, that your app will not be punished if a malicious user uses it to upload Terms of Service violating content, and instead the authorizing user's account will be punished.
update_asset(asset_id, file)
Uploads the file requested file onto roblox, replacing the existing asset. The following asset types and file formats can be updated:
Asset Type | File Formats |
---|---|
rblxopencloud.AssetType.Model |
.fbx |
The asset:read
and asset:write
scopes are required for OAuth2 authorization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asset_id |
int
|
The ID of the asset to update. |
required |
file |
BytesIO
|
The file opened in bytes to be replace the old one. |
required |
Returns:
Type | Description |
---|---|
Union[Asset, PendingAsset]
|
Returns |
Raises:
Type | Description |
---|---|
InvalidAsset
|
The file is either an unsupported type, uploaded as the wrong |
ModeratedText
|
The name or description was moderated by Roblox's text filter. |
InvalidKey
|
The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
Danger
Avoid uploading assets to Roblox that you don't have full control over, such as AI generated assets or content created by unknown people. Assets uploaded that break Roblox's Terms of Services can get your account moderated.
For OAuth2 developers, it has been confirmed by Roblox staff in this DevForum post, that your app will not be punished if a malicious user uses it to upload Terms of Service violating content, and instead the authorizing user's account will be punished.
list_groups(limit=None)
Returns an Iterable of rblxopencloud.GroupMember
for every group the user is a member of.
The openid
and group:read
scopes are required for OAuth2 authorization.
Example
This will print every group the user is a member of, and their role ID in that group.
If you'd like the keys in a list, you can use the list method:Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit |
Optional[int]
|
Will not return more groups than this number. Set to |
None
|
Returns:
Type | Description |
---|---|
Iterable[GroupMember]
|
An Iterable of group memberships. |
Raises:
Type | Description |
---|---|
InvalidKey
|
The API key isn't valid, doesn't have access to list data store keys, or is from an invalid IP address. |
NotFound
|
The user does not exist. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
list_inventory(limit=None, only_collectibles=False, assets=None, badges=False, game_passes=False, private_servers=False)
Returns an Iterable of rblxopencloud.InventoryItem
for every item in the user's inventory. If only_collectibles
, assets
, badges
, game_passes
, and private_servers
are all False
/None
, then all inventory items are returned.
The openid
and user.inventory-item:read
scopes are required for OAuth2 authorization.
Example
This will print every item in the user's inventory.
If you'd like the items in a list, you can use the list method:Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_collectibles |
Optional[bool]
|
Wether the only inventory assets iterated are collectibles (limited items). If |
False
|
assets |
Optional[Union[list[InventoryAssetType], list[int], bool]]
|
If this is |
None
|
badges |
Optional[Union[list[int], bool]]
|
If this is |
False
|
game_passes |
Optional[Union[list[int], bool]]
|
If this is |
False
|
private_servers |
Optional[Union[list[int], bool]]
|
If this is |
False
|
limit |
Optional[int]
|
Will not return more groups than this number. Set to |
None
|
Returns:
Type | Description |
---|---|
Iterable[Union[InventoryAsset, InventoryBadge, InventoryGamePass, InventoryPrivateServer]]
|
An Iterable of all the items in the user's inventory. |
Raises:
Type | Description |
---|---|
InvalidKey
|
The API key isn't valid, doesn't have access to list data store keys, or is from an invalid IP address. |
PermissionDenied
|
The user's inventory is private, and you do not have authorization to access it. |
NotFound
|
The user does not exist. |
RateLimited
|
You've exceeded the rate limits. |
ServiceUnavailable
|
The Roblox servers ran into an error, or are unavailable right now. |
rblx_opencloudException
|
Roblox returned an unexpected error. |
Note
If the user's inventory is private, then you need to gain consent from either OAuth2, or by owning the API key. Otherwise, this method will raise rblxopencloud.PermissionDenied
!
rblxopencloud.InventoryItem
Represents a base item in a user's inventory. This method is usually not returned, however it bases multiple other classes.
Warning
This class isn't designed to be created by users. It is returned by User.list_inventory()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the inventory item. |
rblxopencloud.InventoryAsset
Bases: InventoryItem
Represents a basic inventory item, such as avatar items, and development items.
Warning
This class isn't designed to be created by users. It is returned by User.list_inventory()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the inventory item. |
type |
InventoryAssetType
|
The asset's type. |
instance_id |
int
|
The unique ID of this asset's instance. |
collectable_item_id |
Optional[str]
|
A unique item UUID for collectables. |
collectable_instance_id |
Optional[str]
|
A unique instance UUID for collectables. |
serial_number |
Optional[int]
|
The serial number of the collectable. |
collectable_state |
Optional[InventoryItemState]
|
Wether the item is ready for sale or in hold. |
rblxopencloud.InventoryBadge
Bases: InventoryItem
Represents a badge in a user's inventory.
Warning
This class isn't designed to be created by users. It is returned by User.list_inventory()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the badge. |
rblxopencloud.InventoryGamePass
Bases: InventoryItem
Represents a game pass in a user's inventory.
Warning
This class isn't designed to be created by users. It is returned by User.list_inventory()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the game pass. |
rblxopencloud.InventoryPrivateServer
Bases: InventoryItem
Represents a private server in a user's inventory.
Warning
This class isn't designed to be created by users. It is returned by User.list_inventory()
.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the private server item. |
rblxopencloud.InventoryItemState
Bases: Enum
Enum representing wether the collectable item is in hold, or if the user can sell it.
Attributes:
Name | Type | Description |
---|---|---|
Unknown |
1
|
The current state is unknown. |
Available |
2
|
The user could list the collectable for sale if they have premium. |
Hold |
3
|
The user recently purchased the collectable and can't be sold yet. |
rblxopencloud.InventoryAssetType
Bases: Enum
Enum denoting what type a rblxopencloud.InventoryAsset
is.
Attributes:
Name | Type | Description |
---|---|---|
Unknown |
0
|
The asset type is unknown. |
ClassicTShirt |
1
|
|
Audio |
2
|
|
Hat |
3
|
|
Model |
4
|
|
ClassicShirt |
5
|
|
ClassicPants |
6
|
|
Decal |
7
|
|
ClassicHead |
8
|
|
Face |
9
|
|
Gear |
10
|
|
Animation |
11
|
|
Torso |
12
|
|
RightArm |
13
|
|
LeftArm |
14
|
|
LeftLeg |
15
|
|
RightLeg |
16
|
|
Package |
17
|
|
Plugin |
18
|
|
MeshPart |
19
|
|
HairAccessory |
20
|
|
FaceAccessory |
21
|
|
NeckAccessory |
22
|
|
ShoulderAccessory |
23
|
|
FrontAccessory |
24
|
|
BackAccessory |
25
|
|
WaistAccessory |
26
|
|
ClimbAnimation |
27
|
|
DeathAnimation |
28
|
|
FallAnimation |
29
|
|
IdleAnimation |
30
|
|
JumpAnimation |
31
|
|
RunAnimation |
32
|
|
SwimAnimation |
33
|
|
WalkAnimation |
34
|
|
PoseAnimation |
35
|
|
EmoteAnimation |
36
|
|
Video |
37
|
|
TShirtAccessory |
38
|
|
ShirtAccessory |
39
|
|
PantsAccessory |
40
|
|
JacketAccessory |
41
|
|
SweaterAccessory |
42
|
|
ShortsAccessory |
43
|
|
LeftShoeAccessory |
44
|
|
RightShoeAccessory |
45
|
|
DressSkirtAccessory |
46
|
|
EyebrowAccessory |
47
|
|
EyelashAccessory |
48
|
|
MoodAnimation |
49
|
|
DynamicHead |
50
|
|
CreatedPlace |
51
|
|
PurchasedPlace |
52
|
|