question

andrestallos avatar image
andrestallos asked

Scheduled task to update Store

Hello! We would like to set up an scheduled task to change the items of one of the Stores on a daily basis, iterating through a series of preconfigured 'daily deals'. Is there some way to use the 'SetStoreItems' API call from the CloudScript, or are we constrained to using only the server API? If so, is there some workaround we could use? Thank you!

apisCloudScriptscheduled tasks
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

·
brendan avatar image
brendan answered

At the moment, Tasks are limited to the Server API calls, though we will be exposing Admin functionality for Tasks in a future update. For now, your best approach would be to create the various Stores, and use Title Data to indicate which is the current "live" store.

4 comments
10 |1200

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

andrestallos avatar image andrestallos commented ·

Thanks for the quick reply! We've implemented it the way you suggest, creating multiple different stores and using the Task to update the Title Data pointing to the active one, and it all seems to be working just as we wanted. Thank you!

0 Likes 0 ·
eswitzer07 avatar image eswitzer07 commented ·

Hey,


Just wanted to "bump" this thread. We are trying to achieve the same functionality as the OP (having a store populated randomly via cloudscript). We have all the functions setup in cloud script to process the data, but we are getting:

"StackTrace": "ReferenceError: admin is not defined\n at handlers.AutoStoreUpdate (F588-main.js:234:21)"

Are tasks still not able to fire off admin API calls? We aim to have quite a few items in game, and hand creating all the stores would be a bit of a time sink for something that could be done automatically via cloudscript.

Cheers!

0 Likes 0 ·
brendan avatar image brendan eswitzer07 commented ·

Correct - Admin API calls are not supported via Cloud Script. We are planning on adding more options for managing changes to titles for live events in an upcoming sprint though, so I'd keep an eye on our blog for info on that update. For now, you would need to manage this via a local admin tool, or else use the method described above (for a pre-built set of stores).

0 Likes 0 ·
Wu avatar image Wu brendan commented ·

Almost 5 years later, there is still no possibilities to execute admin api from cloudscript ;)

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.