I'm trying to use CloudScript to get the URL of my Facebook profile picture so I can set it as my PlayFab Avatar.
/*{ // This is the JSON structure returned by the http request "picture": { "data": { "height": 50, "is_silhouette": false, "url": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=10155832140626538&height=50&width=50&ext=1537585061&hash=AeRvbpI6EulgctDz", "width": 50 } }, "id": "10155832140626538" }*/ var url = "https://graph.facebook.com/me/?fields=picture&type=square&access_token="+authToken; var method = "get"; var contentBody = ""; var contentType = "application/json"; var headers = {}; var responseString = http.request(url,method,contentBody,contentType,headers); var payload = JSON.parse(responseString); return (((payload || {}).picture || {}).data || {}).url;
I can access the "picture" and "data" property of the JS object, but never the "url". I can even access the "height", "is_silhouette", and "width" properties by replacing "url" with those properties.
But ... when I access the "url" property, the code stops working, throwing
{ "FunctionResult": null, "Logs": null, "ExecutionTimeSeconds": 0, "MemoryConsumedBytes": 0, "APIRequestsIssued": 0, "HttpRequestsIssued": 0, "Error": { "Error": null, "Message": "There was a problem running testPic. Check your arguments and try again.", "StackTrace": null } }
Is PlayFab blocking or reserving the "url" keyword? I know it's not a JS thing because JS doesn't behave this way, and the code works fine outside of PlayFab.