I would like to access my titleId("XXXX") from cloudscript as simple variable like currentPlayrId. Is it possible?
I would like to access my titleId("XXXX") from cloudscript as simple variable like currentPlayrId. Is it possible?
No, this is the first time this has ever come up, so there's no TitleId define in Cloud Script. What exactly is the usage case? What are you attempting to do that requires a dynamic reference to the Title ID?
ok)) It is not necessary. Just wanted to use it to call AdminApi from cloudscript.
The Admin API is not available to Cloud Script specifically because no Admin API call should ever be triggered due to a player action. We'll be updating in future to differentiate between player-based Cloud Script execution (from a Client API call, a PlayStream Rule, or a Scheduled Task for a Segment), and title-based (a Scheduled Task for the title, rather than a Segment). Once that's in place, we'll be allowing title-based Cloud Script handlers access to the Admin API.
For anyone landing here via search, we now have a global CloudScript object that contains the current Title ID.
script.titleId // Represents the ID for the current title.
script | Global object that contains Revision and titleId . Revision represents the Revision Number for the currently executing CloudScript, and titleId represents the ID for the current title. |
Read more about our global CloudScript objects and variables here
2 People are following this question.