I found the following code in this article:
https://api.playfab.com/docs/tutorials/landing-automation/using-cloud-script-actions-with-playstream
// Post data about the event to an external API var content = JSON.stringify({user: profile.PlayerId, event: psEvent.EventName}); var response = http.request('https://httpbin.org/status/200', 'post', content, 'application/json', null, true); return { externalAPIResponse: response };
What is an external API? For what purposes is an external API normally used when a Cloud Script function is triggered by Rules?
Can I use an external API to get the values of profile.PlayerId and psEvent.EventName in the client code in result.Result.FunctionResult of ExecuteCloudScript API?
For example:
private async Task UpdatePlayerHighscore(string leaderboardname, string playerscore) { var result = await PlayFabClientAPI.ExecuteCloudScriptAsync(new ExecuteCloudScriptRequest() { FunctionName = "UpdateLeaderboard", FunctionParameter = new { Leaderboardname = leaderboardname, Playerscore = playerscore, Level = 1 }, GeneratePlayStreamEvent = true }); if (result.Error != null) Console.WriteLine(result.Error.Error.ToString()); else { if (result.Result.FunctionResult != null) Console.WriteLine(result.Result.FunctionResult.ToString()); } }