SysEditCatalogItem
Update a catalog item on the server.
Service | Operation |
---|---|
itemCatalog | SYS_EDIT_CATALOG_ITEM |
Method Parameters
Parameter | Description |
---|---|
defId | Unique ID identifying catalog item to be updated. |
version | Version of catalog item being edited. |
itemDefData | The data to update on the catalog item. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var defId = "sword001";
var version = 1;
var itemDefData = {
"name": {
"en": "Crimson Sword"
},
"desc": {
"en": "A sword whose blade was forged in Cherry Kool-aid!"
},
"category": "sword",
"tags": [
"weapon",
"pointy"
],
"buyPrice": {
"coins": 200
},
"sellPrice": {
"coins": 150
},
"image": "//xxx.jpg",
"resourceGroup": "equipment.asset",
"resourceTag": "sword001",
"meta": {
"speed": 85,
"damage": 12,
"accuracy": 80,
"range": 5
},
"initData": {
"condition": 100,
"bonus": 0
},
"stackable": false,
"consumable": false,
"uses": 1,
"coolDownSecs": 0,
"recoverySecs": 0,
"activatable": false,
"statusName": null,
"activeSecs": 0,
"tradable": false,
"blockchain": false,
"blockchainDefId": null
};
var itemCatalogProxy = bridge.getItemCatalogServiceProxy();
var postResult = itemCatalogProxy.sysEditCatalogItem(defId, version, itemDefData);
if (postResult.status == 200) {
// Success!
}
{
"service": "itemCatalog",
"operation": "SYS_EDIT_CATALOG_ITEM",
"data": {
"defId": "sword001",
"version": 1,
"itemDefData": {
"name": {
"en": "Crimson Sword"
},
"desc": {
"en": "A sword whose blade was forged in Cherry Kool-aid!"
},
"category": "sword",
"tags": [
"weapon",
"pointy"
],
"buyPrice": {
"coins": 200
},
"sellPrice": {
"coins": 150
},
"image": "//xxx.jpg",
"resourceGroup": "equipment.asset",
"resourceTag": "sword001",
"meta": {
"speed": 85,
"damage": 12,
"accuracy": 80,
"range": 5
},
"initData": {
"condition": 100,
"bonus": 0
},
"stackable": false,
"consumable": false,
"uses": 1,
"coolDownSecs": 0,
"recoverySecs": 0,
"activatable": false,
"statusName": null,
"activeSecs": 0,
"tradable": false,
"blockchain": false,
"blockchainDefId": null
}
}
}
JSON Response
{
"data": {
"defId": "sword001",
"name": {
"en": "Crimson Sword"
},
"desc": {
"en": "A sword whose blade was forged in Cherry Kool-aid!"
},
"type": "ITEM",
"category": "sword",
"tags": ["weapon", "pointy"],
"buyPrice": {
"coins": 200
},
"sellPrice": {
"coins": 150
},
"image": "//xxx.jpg",
"resourceGroup": "equipment.asset",
"resourceTag": "sword001",
"meta": {
"speed": 85,
"damage": 12,
"accuracy": 80,
"range": 5
},
"initData": {
"condition": 100,
"bonus": 0
},
"pState": "DRAFT",
"publishedAt": 0,
"createdAt": 1567192113061,
"updatedAt": 1567192188475,
"version": 2,
"stackable": false,
"consumable": false,
"uses": null,
"coolDownSecs": 0,
"recoverySecs": 0,
"activatable": false,
"statusName": null,
"activeSecs": null,
"tradable": false,
"blockchain": false,
"blockchainDefId": null
},
"status": 200
}