클라우드

InventoryItem

Represents an item in a user's inventory.

특성

pathstring

The resource path of the inventory item.

Format: users/{user_id}/inventory-items/{inventory_item_id}.

details에 대해 다음 중 하나 선택 가능:

assetDetailsobject

Populated if this item is an asset.

badgeDetailsobject

Populated if this item is a badge.

gamePassDetailsobject

Populated if this item is a game pass.

privateServerDetailsobject

Populated if this item is a private server.

addTimestring
출력 전용

The time when the item was added to the user's inventory. For example, the time when the user purchased a private server or was awarded a badge.

This field is currently not populated for passes. 이 문자열은 Timestamp 형식으로 지정됩니다.

기본 URL

https://apis.roblox.com
InventoryItem 리소스

{
"path": "users/123/inventory-items/some-inventory-item-id",
"assetDetails": {
"assetId": "12928981934",
"inventoryItemAssetType": "INVENTORY_ITEM_ASSET_TYPE_UNSPECIFIED",
"instanceId": "173413781720",
"collectibleDetails": {
"itemId": "521cca19-75bb-4e05-a0af-633b1532c24d",
"instanceId": "a8a27d38-ee51-4cf4-8b0a-485d0dfd8607",
"instanceState": "COLLECTIBLE_ITEM_INSTANCE_STATE_UNSPECIFIED",
"serialNumber": 160
}
},
"addTime": "2023-07-05T12:34:56Z"
}

InventoryItem

List Inventory Items
베타

GET /cloud/v2/users/{user_id}/inventory-items

List the inventory items in a user's inventory.

The inventory items returned depend on the target user’s choice under Settings > Privacy > Who can see my inventory?:

  • If the user granted inventory visibility to "Everyone," then any API key or OAuth2 token can be used to view the target’s inventory, no matter what scopes it has or who created it.
  • If the user has not granted inventory visibility to "Everyone":
    • Their inventory can still be viewed with an API key created by the target user with Inventory: Read permission.
    • Their inventory can still be viewed with an OAuth2 token if the target user authorizes an app requesting permissions for the user.inventory-item:read scope.

Rate Limits:

  • API Keys - 100 requests/minute per API key owner (can be user or group). Rate limits are enforced across all of an owner's API keys.
  • OAuth2 Tokens - 20 requests/minute per OAuth2 access token
요청경로 매개 변수
user_idstring
필수

The user ID.

쿼리 매개 변수
maxPageSizenumber

The maximum number of inventory items to return. The service might return fewer than this value. If unspecified, at most 10 inventory items 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.

See the filtering documentation for more information.

응답

A list of InventoryItems in the parent collection.

inventoryItemsarray<InventoryItem>

The InventoryItems from the specified User.

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/users/{user_id}/inventory-items

curl -L -X GET 'https://apis.roblox.com/cloud/v2/users/{user_id}/inventory-items?maxPageSize=10&pageToken={string}&filter={string}' \
-H 'x-api-key: {your-api-key}'
응답

{
"inventoryItems": [
{
"path": "users/123/inventory-items/some-inventory-item-id",
"assetDetails": {
"assetId": "12928981934",
"inventoryItemAssetType": "INVENTORY_ITEM_ASSET_TYPE_UNSPECIFIED",
"instanceId": "173413781720",
"collectibleDetails": {
"itemId": "521cca19-75bb-4e05-a0af-633b1532c24d",
"instanceId": "a8a27d38-ee51-4cf4-8b0a-485d0dfd8607",
"instanceState": "COLLECTIBLE_ITEM_INSTANCE_STATE_UNSPECIFIED",
"serialNumber": 160
}
},
"addTime": "2023-07-05T12:34:56Z"
}
],
"nextPageToken": "string"
}