GetItemPromotionalDetails
Returns list of promotional details for the specified item definition, for promotions available to the current user.
| Service | Operation |
|---|---|
| userItems | GET_ITEM_PROMOTIONAL_DETAILS |
Method Parameters
| Parameter | Description |
|---|---|
| defId | The unique id of the item definition to check. |
| shopId | The id identifying the store the item is from, if applicable. |
| includeDef | If true, the associated item definition will be included in the response. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string defId = "sword001";
string shopId = "None";
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.GetItemPromotionalDetails(defId, shopId, includeDef, successCallback, failureCallback);
const char *defId = "sword001";
const char *shopId = "None";
bool includeDef = True;
_bc.getUseritemsService().getItemPromotionalDetails(defId, shopId, includeDef, this);
NSString *defId = @"sword001";
NSString *shopId = @"None";
BOOL includeDef = True;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc userItemsService] getItemPromotionalDetails:
defId:defId
shopId:shopId
includeDef:includeDef
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil]
String defId = "sword001";
String shopId = "None";
bool includeDef = True;
this; // implements IServerCallback
_bc.getUseritemsService.getItemPromotionalDetails(defId, shopId, includeDef, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var defId = "sword001";
var shopId = "None";
var includeDef = True;
_bc.userItems.getItemPromotionalDetails(defId, shopId, includeDef, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var defId = "sword001";
var shopId = "None";
var includeDef = True;
ServerResponse result = await _bc.userItemsService.getItemPromotionalDetails(defId:defId, shopId:shopId, includeDef:includeDef);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var defId = "sword001";
var shopId = "None";
var includeDef = True;
var userItemsProxy = bridge.getUseritemsServiceProxy();
var postResult = userItemsProxy.getItemPromotionalDetails(defId, shopId, includeDef);
{
"service":"userItems",
"operation":"GET_ITEM_PROMOTIONAL_DETAILS",
"data":{
"defId":"sword001",
"shopId":null,
"includeDef":true
}
}
JSON Response
{
"data": {
"itemDef": {
"defId": "s001",
"name": "Sword",
"desc": "weapon",
"type": "ITEM",
"category": "weapon",
"tags": null,
"buyPriceDisabled": false,
"buyPrice": {
"bar": 88
},
"sellPrice": {},
"image": null,
"resourceGroup": null,
"resourceTag": null,
"meta": null,
"pState": "PUBLISHED",
"publishedAt": 1713324249793,
"stackable": true,
"maxStackable": 1,
"tradable": false,
"blockchain": false,
"consumable": false,
"uses": null,
"coolDownSecs": 0,
"recoverySecs": 0,
"activatable": false,
"statusName": null,
"activeSecs": null,
"maxActiveSecs": null,
"statusBehaviour": null
},
"promotions": [
{
"gameId": "23782",
"promotionId": 1,
"type": "AUTOMATED",
"name": "test",
"message": "test",
"enabled": true,
"segments": [
1
],
"prices": [
{
"itemId": "comearmarkcpeappunlimited",
"priceId": 0
}
],
"notifications": [],
"duration": 10,
"customJson": {
"priority": 100,
"itemIds": {
"barBundle1Imp": {
"currency": {
"bars": 12
},
"extra": {
"specialItemReward": "bonusItemA"
}
},
"gemcollection": {
"currency": {
"gems": 7
},
"extra": {
"specialItemReward": "bonusItemA"
}
}
}
},
"isRetriggerable": true,
"maxRetriggers": null,
"maxPurchases": null,
"createdAt": 1612991666850,
"updatedAt": 1764000936099,
"version": 8,
"items": {
"s001": {
"defId": "s001",
"buyPrice": {
"bar": 44
}
}
},
"triggeredForUserAt": 1764000265580,
"expiresForUserAt": 1764036265580
}
]
},
"status": 200
}