> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET (/users/me/inventory)

> GET (/users/me/inventory)

# GET (/users/me/inventory)

向调用者返回当前与所提供用户关联的库存集。
这些 URI 的域为 `inventory.xboxlive.com`。

* [备注](#ID4EV)
* [查询字符串参数](#ID4EHB)
* [请求示例](#ID4EDE)
* [响应正文](#ID4ERE)

## 备注

作为此调用的一部分,不会执行任何策略检查、强制执行或筛选。调用者可以选择传递查询参数,以缩小返回结果的范围。

调用者可以使用先前响应中提供的延续令牌对结果进行分页:**/users/me/inventory?continuationToken=continuationTokenString**。

调用者可以使用特定的项 URL 调用 details API,以查看特定项的相关信息。

## 查询字符串参数

| 参数 | 类型 | 说明 |
| - | - | - |
| availability | string | 要返回的项的当前可用性。默认值为 "Available",它返回当前日期介于开始日期和结束日期范围之间的项。其他值包括 "All"(返回所有项)和 "Unavailable"(返回当前日期在开始日期和结束日期范围之外因此当前不可用的项)。 |
| container | string | 可选。如果将该值设置为某个游戏的产品 ID,则库存结果仅包含与该游戏相关的项。当从服务器调用库存以将结果筛选到特定游戏的产品时,此参数特别有用。 |
| expandSatisfyingEntitlements | string | 一个标志,指示响应是否在返回的结果中包含用户拥有的所有满足性授权。默认值为 "false"。当此参数的值为 "true" 时,通过满足性授权授予用户的任何产品(例如捆绑项、迁移到 XBOX One 的 XBOX 360 购买项、订阅权益等)都将添加到结果中。如果此值为 "false",则结果中仅返回父项(例如 Bundle 的 ProductID),而不返回单个包含的项。**注意:** 只有当 URI 中未包含 itemType 参数时,才支持将此参数设置为 "true";否则,将收到 HTTP 400 错误。 |
| productIds | string | 您希望专门从用户库存中检索的一组 ProductId,以 "," 分隔。如果用户的库存结果中没有所提供的 ProductID,则该项将不会出现在 API 调用的结果中。如果传入某个 bundle 的 productID 且将 expandSatisfyingEntitlements 参数设置为 true,则该 bundle 中包含的所有项都将在调用结果中返回(无论是否在查询字符串中指定了它们的 productIds)。 |
| state | string | 要返回的项的状态。默认值为 "all",它返回所有项。其他值包括 "Enabled"(表示仅返回启用的项)、"Suspended"(表示仅返回已挂起的项)、"Expired"(表示仅返回已过期的项)、"Cancelled"(表示仅返回已取消的项)和 "Renewed"(表示仅返回已续订的项)。 |

除此之外,该资源还支持标准的分页机制。

## 请求示例

此 URI 方法的完全限定域名为 `https://inventory.xboxlive.com/users/me/inventory。
		 `

> **注意:**\
> 考虑哪些用户取决于所提供的令牌,该令牌可能包含多个用户。如果需要单个用户的库存,则还必须提供想要唯一考虑的特定用户的用户哈希值。

.

## 响应正文

如果调用成功,服务将返回一个库存项数组。请参见 [inventoryItem (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-inventoryitem)。

### 响应示例

```cpp theme={null}
{
  "pagingInfo": {
    "continuationToken": string,
    "totalItems": int
  },
  "items":
  {
    "url": string,
    "itemType": "Music",
    "titleId": string,
    "containers": string,
    "obtained": DateTime,
    "startDate": DateTime,
    "endDate": DateTime,
    "state": "Enabled"  
}

```

## 另请参阅

##### 父主题

[/users/me/inventory](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/marketplace/uri-inventory)

##### 更多信息

[EDS 通用标头](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/edscommonheaders)

[EDS 参数](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/edsparameters)

[EDS 查询精简器](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/edsqueryrefiners)

[Marketplace URIs](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/marketplace/atoc-reference-marketplace)

[其他参考](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/atoc-xboxlivews-reference-additional)


## Related topics

- [Get User Inventory](https://devdocs.xbox.com/services/playfab/api-references/rest/admin/player-item-management/get-user-inventory.md)
- [Get Character Inventory](https://devdocs.xbox.com/services/playfab/api-references/rest/server/player-item-management/get-character-inventory.md)
- [Requesting a User Store ID from your service with X-tokens or OAuth 2.0](https://devdocs.xbox.com/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [Solicitud de un User Store ID desde su servicio con tokens X u OAuth 2.0](https://devdocs.xbox.com/es/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [使用 X-token 或 OAuth 2.0 从服务中请求 User Store ID](https://devdocs.xbox.com/zh-CN/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
