question

txstable avatar image
txstable asked

Expected Object at path Data, Invalid JSON in request UpdateUserData

Hey all

So i have a website where players first register their account. The request works and the players info gets added to my database. They are then redirected to the login page. Login works fine via Username/password. While on the same page there is a button i put called connect wallet. When the user hits it, the connect wallet field fills in with the users wallet string.

He then needs to click submit where an UpdateUserData call is made. I get failures that are mentioned above. Here is my code for the request. Im not entirely sure if the structure is correct.

function connectWallet()

{ logLine( "Attempting PlayFab Registration" );

PlayFabClientSDK.UpdateUserData({


"Data": document.getElementById("cryptowallet").value,
"Permission": "Public"


}, onPlayFabResponse);

Thanks

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

As UpdateUserData mentioned, the Data should be an Object which includes the Key-value pairs to be written to the custom data. You can refer to the code below.

"Data":{

	"Key1":"Value1",

	"Key2":"Value2"
}
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.