See question; is it possible to execute Admin API calls via CloudScript?
See question; is it possible to execute Admin API calls via CloudScript?
Not currently, no. We do plan to provide a way to use the Admin API from scripts which are specifically triggered as title-level Tasks (not against a Segment) in a future update, for purposes of making configuration changes to a game to support things like events. What is it that you want to do specifically, though? We may be able to help you design something suited to your game's needs.
Thanks for the answer. We want to be able to reset a specific statistic on specific/scheduled moments (not just daily, weekly or monthly). It's not pratical for us to reset the statistic manually via the GameManager.
Then I would recommend using a local script/tool which makes the call to increment the statistic at the correct time. We'll be providing a way to specify the time of a leaderboard reset in a future update.
"We'll be providing a way to specify the time of a leaderboard reset in a future update."
It's been a long time and I can't find if this future update has happen.
What I did find as a solve:
You can make URL calls, these URL calls can be the Playfab title Admin endpoints.
Unless I'm missing a huge security issue here, the cloud script can use an api key to call admin endpoints, and most importantly for me, from a scheduled task with a custom Cron time argument.
It is possible to call Admin API by creating HTTP calls in Cloud Script, but it is not suggested. If you write the function properly, even you store api key in Cloud Script, there won't be secure issues because the players can only send requests and get responses. Caller identity information can be verified before any administrative actions are taken (through context function parameter). Please also note that only the administrator can review the cloud script source code.
If using Azure Function, you can store API keys in configuration parameters in Azure portal, which means there won't be API key plain text in your code. To call Admin API, you can define a PlayFab Admin Instance API.
3 People are following this question.
Unable to build the necessary environment for playfab cloudscript using azure functions.
How to see multiplayer server cloudscript calls through playstream?
Using Custom Tags with Email verification rule
How to ensure the same API performance with Azure function and PlayFab for global players?
Occasional error on API calls - A third-party downstream provider returned an error...