question

steven avatar image
steven asked

UpdateUserData return json error

I'm getting an error when trying to run this code in Unity 2018.3 : The detailed error message says "The value for key test_key was not valid JSON."

PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest() {
            Data = new Dictionary<string, string>() {
                {"key", "value"}
            },
            Permission = UserDataPermission.Public
        }, 
        result => Debug.Log("Successfully updated user data"),
        error => {
            Debug.Log("UpdateUserData error");
        });

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

·
Hernando avatar image
Hernando answered

I guess that you have checked this option Require valid JSON for custom data values in [Game manager] -> [Settings] -> [API features]. Please refer this thread for details: https://community.playfab.com/questions/17845/cloudscript-updateuserreadonlydata-error.html

1 comment
10 |1200

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

steven avatar image steven commented ·

That fixed it, (found the setting in Settings > Api Features)

0 Likes 0 ·

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.