# 获取用户拥有的游戏列表

获取用户拥有的游戏列表。响应将包含指定用户拥有的一组游戏。


  注意
    所有项目对响应中可获取的商品数量均有限制。默认值和最大值均为每个响应50个商品。如需按页获取更多数据，请使用limit和offset字段。





  注：
    未经授权使用此API调用时，会返回通用商品目录数据。如需获取
    个性化
    用户数据，例如与商品相关的数量限制和促销活动，请使用授权。为此，请在Authorization请求头中传递用户JWT。
    有关用户JWT的更多信息，请参阅此调用的Security部分。

Endpoint: GET /v2/project/{project_id}/entitlement
Version: 2.0.0
Security: XsollaLoginUserJWT

## Path parameters:

  - `project_id` (integer, required)
    项目ID。您可以在发布商帐户的项目名称旁找到此参数；使用项目时，也可以在浏览器地址栏中找到此参数。URL格式如下：https://publisher.xsolla.com//projects/。
    Example: 44056

## Query parameters:

  - `limit` (integer)
    页面上元素数量的限制。
    Example: 50

  - `offset` (integer)
    生成列表时作为起始位置的元素编号（从0开始计数）。

  - `sandbox` (integer)
    要返回的权益类型。如果该参数设置为1，则仅返回用户在沙盒模式下收到的权益。如果未传递该参数或设置为0，则仅返回用户在实时模式下收到的权益。要返回的权益类型。如果该参数设置为1，则仅返回用户在沙盒模式下收到的权益。如果未传递该参数或设置为0，则仅返回用户在实时模式下收到的权益。

  - `additional_fields[]` (array)
    附加字段列表。如果在请求中发送这些字段，则它们将包含在响应中。可用字段attributes。

## Response 200 fields (application/json):

  - `has_more` (boolean)
    用作指示还有更多页面。

  - `total_items_count` (integer)
    系统中的商品总数。

  - `items` (array)

  - `items.name` (string)
    游戏套餐名称。

  - `items.description` (string)
    游戏套餐描述。

  - `items.project_id` (integer)
    项目ID。您可以在[发布商帐户](https://publisher.xsolla.com/)的项目名称旁边找到。

  - `items.game_sku` (string)
    唯一游戏Key套餐ID。

  - `items.drm` (string)
    唯一DRM ID。
    Enum: "steam", "playstation", "xbox", "uplay", "origin", "drmfree", "gog", "epicgames", "nintendo_eshop", "discord_game_store", "oculus", "rockstar", "viveport", "stadia"

  - `items.image_url` (string)
    图片URL。为确保图片能在支付UI中正确显示并快速加载，请查看我们的图片和URL指南：支持的格式：WebP（推荐）、PNG、JPG。文件大小：≤50 KB（WebP）或≤150 KB（PNG和JPG）。图片尺寸：280 x 280 px。色彩空间：sRGB。协议：HTTPS，并对版本化URL使用长期缓存。

  - `items.is_pre_order` (boolean)
    游戏是否处于预售状态。

  - `items.attributes` (array)
    游戏对应的属性及属性值列表。

注意：仅当发送additional_fields[]=attributes查询参数时，响应中才会提供此部分。

  - `items.attributes.external_id` (string)
    唯一属性ID。 external_id只能包含大小写英文字母、数字、短横线和下划线。

  - `items.attributes.name` (string)
    属性名称。
    Example: "Genre"

  - `items.attributes.values` (array)

  - `items.attributes.values.external_id` (string)
    属性的唯一值ID。 external_id只能包含小写英文字母、数字、短横线和下划线。

  - `items.attributes.values.value` (string)
    属性值。
    Example: "Strategy"

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1020

  - `errorMessage` (string)
    Example: "[0401-1020]: Error in Authentication method occurred"


