Skip to main content
Version: 5.7.0

GetUserItemsPage

Retrieves the page of user's inventory from the server based on the context. If includeDef is true, response includes associated itemDef with each user item, with language fields limited to the current or default language.

ServiceOperation
userItemsGET_USER_ITEMS_PAGE

Method Parameters

ParameterDescription
contextThe json context for the page request.
includeDefIf true, the associated item definition will be included in the response.

Usage

http://localhost:3000
string context = "{\"pagination\":{\"rowsPerPage\":50,\"pageNumber\":1},\"searchCriteria\":{\"defId\":\"sword001\"},\"sortCriteria\":{\"createdAt\":1,\"updatedAt\":-1}}";
bool includeDef = true;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.UserItemsService.GetUserItemsPage(context, includeDef, successCallback, failureCallback);
JSON Response
{
"data": {
"context": "eyJzZWFyY2hDcml0ZXJpYSI6eyJnYW1lSWQiOiIyMzQwMyIsInBsYXllcklkIjoiOGNlNmU0NzUtMzVhOS00MmY2LWJhMDgtMjA2YmQwNzY1MGNhIiwiZ2lmdGVkVG8iOm51bGx9LCJzb3J0Q3JpdGVyaWEiOnsiY3JlYXRlZEF0IjoxLCJ1cGRhdGVkQXQiOi0xfSwicGFnaW5hdGlvbiI6eyJyb3dzUGVyUGFnZSI6NTAsInBhZ2VOdW1iZXIiOjF9LCJvcHRpb25zIjpudWxsfQ",
"results": {
"count": 1,
"page": 1,
"items": [
{
"itemId": "2f100f95-60cd-436e-b973-e33cbc6b3728",
"defId": "medal_bronze_2",
"quantity": 1,
"usesLeft": null,
"coolDownStart": -1,
"recoveryStart": -1,
"itemData": {},
"giftedTo": null,
"giftedFrom": null,
"blockId": null,
"createdAt": 1566849320462,
"updatedAt": 1566849320462,
"version": 1,
"maxUses": null,
"coolDownUntil": -1,
"recoveryUntil": -1,
"itemDef": {
"defId": "medal_bronze_2",
"name": "Medium Bronze Medal",
"desc": "",
"type": "ITEM",
"category": "collectable",
"tags": [
"medal"
],
"buyPrice": {},
"sellPrice": {},
"image": null,
"resourceGroup": null,
"resourceTag": null,
"meta": {},
"pState": "PUBLISHED",
"publishedAt": 1566585957049,
"stackable": false,
"consumable": false,
"uses": null,
"coolDownSecs": 0,
"recoverySecs": 0,
"activatable": false,
"statusName": null,
"activeSecs": null,
"tradable": false,
"blockchain": false,
"blockchainDefId": null
}
}
],
"moreAfter": false,
"moreBefore": false
}
},
"status": 200
}