question

brendan avatar image
brendan asked

Error 400: Invalid input parameters on UpdateUserData

lango
started a topic on Thu, 03 September 2015 at 7:37 PM

I've updated the PlayFab unity package to the latest commit from September 1st.

Without changing my code from before the commit, I now receive "Error 400: Invalid input parameters" when calling PlayFabClientAPI.UpdateUserData

To test that the format of UpdateUserDataRequest is correct, I setup a call with fake data.

public void FakeUserData ()
        {
            Debug.Log ("FakeUserData");

            Dictionary<string,string> data = new Dictionary<string,string> ();

            data ["fake_key"] = "fake_value";

            PlayFabClientAPI.UpdateUserData (
                new UpdateUserDataRequest {
                    Data = data,
                    Permission = UserDataPermission.Public
                },
                OnUpdateUserDataSuccess,
                OnError);
        }

The call returns this error log.

PlayFabError 400: Invalid input parameters
UnityEngine.Debug:Log(Object)
Managers.PlayFabManager:OnError(PlayFabError) (at Assets/Scripts/Managers/PlayFabManager.cs:287)
PlayFab.<UpdateUserData>c__AnonStoreyA7:<>m__E4(String, PlayFabError) (at Assets/PlayFabSDK/Public/PlayFabClientAPI.cs:1470)
PlayFab.Internal.<MakeRequestViaUnity>c__Iterator5:MoveNext() (at Assets/PlayFabSDK/Internal/PlayFabHTTP.cs:254)

Do you know what might be the problem?

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

·
brendan avatar image
brendan answered

3 Comments
Brendan Vanous said on Fri, 04 September 2015 at 12:43 AM

There should always be an errorDetails returned with any error message from our service. Can you check to see what it is? Looking at your code, I suspect that the UserDataPermission,Pubic is the issue, since the Permission needs to be a string - either "Public" or "Private", depending on your need.

Brendan


lango said on Fri, 04 September 2015 at 12:56 AM

You're right, I didn't realize the UserDataPermission defines were enum, not string.

I'm not sure why it wasn't throwing an error before. Anyway, thank you.


Brendan Vanous said on Fri, 04 September 2015 at 12:59 AM

Great - glad to hear it's working for you now! :)

2 comments
10 |1200

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

harshil912 avatar image harshil912 commented ·

The UpdateUserData api or infact any other update api's don't seem to work.

A standard message is received on any update request with key-value pair in Data param.

{"code":400,"status":"BadRequest","error":"InvalidParams","errorCode":1000,"errorMessage":"Invalid input parameters","errorDetails":{"Data":[""]}}
0 Likes 0 ·
brendan avatar image brendan harshil912 commented ·

They're working fine in all our testing. As stated in the other thread where you asked this, if you can post the Title ID and the details of the call you're making, we can follow up with you there.

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.