question

khasduc avatar image
khasduc asked

UpdateCatalogItems on CloudScript not working!

    var createRequest = {
        CatalogVersion : "Karts",
        Catalog : [{
            CanBecomeCharacter : false,
            DisplayName : catalog.Catalog[args.kartIndex].DisplayName,
            InitialLimitedEditionCount : 1,
            IsLimitedEdition : true,
            IsStackable : false,
            IsTradable : false,
            ItemClass : catalog.Catalog[args.kartIndex].Class,
            ItemId : index,
            CustomData : {
                "owner" : currentPlayerId,
                
                "type" : 0,
                "level" : 0,
                "stamina" : 100,
                
                "hp" : 100,
                "mana" : 100,
                "speed": 20,
                "skill1" : 0,
                "skill2" : 0,
                "cooldown" : 0,
                
                "accessory" : ""
            }
        }]
    };
    var createNewKart = server.UpdateCatalogItems(createRequest);

I try to add a new item to catalog for my game but its not working!
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

Since the UpdateCatalogItems is an admin API and CloudScript does not support calling admin API, so it cannot work. I recommend you to use Azure Function to implement this feature. You can alse use Postman to call this API.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

khasduc avatar image khasduc commented ·

Many thanks

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.