Is it better to make the API call UpdateUserTitleDisplayName in Azure functions instead of the normal cloud script? Why would it be better?
I always check the DesiredDisplayname in cloud script before I call UpdateUserTitleDisplayName. For example, I don't want to allow certain characters in the display name, therefore I always need to check the DesiredDisplayname before updating it.
I call UpdateUserTitleDisplayName like this in the normal cloud script:
function UpdateUserTitleDisplayNameFromCloudScript(DesiredDisplayname, PlayFabId) { var contentBodyTemp = { "DisplayName": DesiredDisplayname, "PlayFabId": PlayFabId }; let url = "https://E5E2C.playfabapi.com/Admin/UpdateUserTitleDisplayName"; let method = "POST"; let contentBody = `{"PlayFabId": "${PlayFabId}", "DisplayName": "${DesiredDisplayname}"}`; let contentType = "application/json"; let headers = { "X-SecretKey": "..." }; let responseString = http.request(url, method, contentBody, contentType, headers); let responseJSONObj = JSON.parse(responseString); return (responseJSONObj); }
How can I make the same call in Azure functions?
I have already created a new function(from the quickstart tutorial) in Visual Studio Code, but I don't know how to make a PlayFab API call in Azure function. How can I call UpdateUserTitleDisplayName in Azure functions?
Can I delete the entire code from the quickstart tutorial in HttpExample.cs and replace it with a UpdateUserTitleDisplayName API call?