,
I have set-up a Scheduled Task to run once weekly using the Revisions(legacy) section on the playfab dashboard. The problem is, I need to call CreatePlayerStatisticDefinition and IncrementPlayerStatisticVersion at the same time that my Scheduled Task runs. These functions are part of the Playfab Admin API which is reportedly (past report) impossible to call from the server. However, reportedly "You can make URL calls, these URL calls can be the Playfab title Admin endpoints." So this is now what I am trying to achieve. My problem is that I have no idea how to do this... I have been digging through a lot of the documentation (specifically webhook-calls-from-cloudscript and Rest-API) But I'm afraid I am in a bit over my head and I am not able to fully understand how to make a call to the IncrementPlayerStatisticVersion endpoint from my code on the Revisions(legacy) playfab server. I think my code needs to look something like this:
var url = "https://[titleID].playfabapi.com/Admin/IncrementPlayerStatisticVersion"; var method = "post"; var contentBody = ""; var contentType = "application/json"; var headers = {}; var responseString = http.request(url,method,contentBody,contentType,headers);
Where obviously I need to replace [titleID] with my title ID and to include somewhere an X-SecretKey and a Statistic name argument, though I have no clue how these arguments should be formatted or what they should look like. Normally I can look at a similar example and derive what my method should look like from there, but I have not been able to find such useful information in this case. I don't even know what the code to http.request looks like so I feel I am just grasping at straws in this case. Any help or advice you can give regarding calling these Playfab Admin API functions from the server and/or structuring the clousdcript requests would be greatly appreciated!
I have a feeling a suggestion might be to use Azure functions but I have never touched Azure and would prefer not open a new can of worms when I am already so close to the functionality I am trying to achieve here. I don't have any way of running a scheduled task with my own tools or have much expertise in these types of cloud computing so any bit of help would go a long way.