I get the following response if I use Server/AuthenticateSessionTicket in Postman:
{ "code": 200, "status": "OK", "data": { "UserInfo": { "PlayFabId": "8882308D85826F31", "Created": "2019-12-22T08:22:30.749Z", "Username": "postmanuser", "TitleInfo": { "DisplayName": "PostmanDisplayname", "Origination": "Organic", "Created": "2019-12-22T08:22:30.937Z", "LastLogin": "2019-12-25T18:54:49.545Z", "FirstLogin": "2019-12-22T08:22:30.937Z", "isBanned": false, "TitlePlayerAccount": { "Id": "7BBDEEBC993F528B", "Type": "title_player_account", "TypeString": "title_player_account" } }, "PrivateInfo": { "Email": "postmanemail@test.com" } } } }
But I can not find the creation date of the SessionTicket. What is the creation date in this example? Is it data.UserInfo.Created?
And in my cloud script I get an exception if I want to get data.UserInfo.Created.
"Error": { "Error": "JavascriptException", "Message": "JavascriptException", "StackTrace": "TypeError: Cannot read property 'UserInfo' of undefined\n at handlers.GetSessionTicketCreationDate (BFD0A-main.js:600:49)\n at Object.invokeFunction (Script:116:33)" }
handlers.GetSessionTicketCreationDate = function (args, context) { var result = server.AuthenticateSessionTicket( { SessionTicket: args.Sessionticket }); var sessionticketcreationdate = ""; if (result.Error == null) { sessionticketcreationdate = result.data.UserInfo.Created; } else sessionticketcreationdate = "Could not get SessionTicket creation date." return sessionticketcreationdate; }
How can I get the SessionTicket creation date in Cloud Script?