question

beaconFreelance avatar image
beaconFreelance asked

HTTP/1.1 400 Bad Request error when calling GetUserData()

HI Guys! I used These Codes In my Project It Save data successfully

void SetUserData()
    {
        PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest()
        {
            Data = new Dictionary<string, string>() {
            {"Ancestor", "That Good Number One"},
            {"Successor", "Keep It Up You Are Second"}
        }
        },
        result => Debug.Log("Successfully updated user data"),
        error => {
            Debug.Log("Got error setting user data Ancestor to Arthur");
            Debug.Log(error.GenerateErrorReport());
        });
    }

But When I want Retrieve data back it through error : HTTP/1.1 400 Bad Request

here is getuserdata code

void GetUserData()
    {
        PlayFabClientAPI.GetUserData(new GetUserDataRequest()
        {
            
            PlayFabId = "C1536",
            Keys = null
        }, result => {
            Debug.Log("Got user data:");
            if (result.Data == null || !result.Data.ContainsKey("Ancestor")) Debug.Log("No Ancestor");
            else Debug.Log("Ancestor: " + result.Data["Ancestor"].Value);
        }, (error) => {
            Debug.Log("Got error retrieving user data:");
            Debug.Log(error.GenerateErrorReport());
        });
    }

My Title id: C1536

error log

Got error retrieving user data:
UnityEngine.Debug:Log(Object)
<>c:<GetUserData>b__32_1(PlayFabError) (at Assets/Scripts/Assembly-CSharp/GameManager.cs:214)
PlayFab.Internal.PlayFabUnityHttp:OnError(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:275)
PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:161)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
/Client/GetUserData: HTTP/1.1 400 Bad Request
UnityEngine.Debug:Log(Object)
<>c:<GetUserData>b__32_1(PlayFabError) (at Assets/Scripts/Assembly-CSharp/GameManager.cs:215)
PlayFab.Internal.PlayFabUnityHttp:OnError(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:275)
PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:161)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Player Dataunity3d
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

·
beaconFreelance avatar image
beaconFreelance answered

Sorry I put My Own Playfab Title Id in playerID

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.