question

andrey avatar image
andrey asked

Exception 400 BadRequest

We have Unhandled exception on login:

"PlayFabError(ServiceUnavailable, Unhandled exception in Post : https://7EB4.playfabapi.com/Client/LoginWith.., 400 BadRequest)"

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.

Joshua Strunk avatar image Joshua Strunk commented ·

You are going to need to post more details about the request. I suggest posting the actual API calls and the details of the request object you are attempting to post.

edit: looks like I was 60 seconds late.

1 Like 1 ·
brendan avatar image
brendan answered

Can you post the complete error response? A 400 error will always contain an error, errorMessage, and errorDetails that will help to solve the question of why the error occurred. Here's an example:

{
    "code": 400,
    "status": "BadRequest",
    "error": "InvalidParams",
    "errorCode": 1000,
    "errorMessage": "Invalid input parameters",
    "errorDetails": {
        "CustomId": [
            "The CustomId field is required."
        ]
    }
}
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.

andrey avatar image andrey commented ·

Hello @Brendan,

error.ErrorDetails is null

Here is callstack:

NotSupportedException: https://7eb4.playfabapi.com/client/loginwithxbox
at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in <filename unknown>:0
at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0
at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in <filename unknown>:0
at PlayFab.Internal.PlayFabWebRequest.Post (PlayFab.Internal.CallRequestContainer reqContainer) [0x00009] in Assets\PlayFabSdk
hared\Internal\PlayFabHttp\PlayFabWebRequest.cs:178
LoginWithXboxRequest request = new LoginWithXboxRequest();
 request.XboxToken = this.xboxToken;
 request.TitleId = ServersConfig.playFabTitleId;
 request.CreateAccount = true;

 PlayFabHttp.MakeApiCall<LoginResult>("/Client/LoginWithXbox", 
request, AuthType.None, this.onAuthenticate, this.onFailedAuth);


We have Exception in Post method, that is why we do not see request in logs. Why can it crash on creating request?

0 Likes 0 ·
brendan avatar image brendan andrey commented ·

Since we're only allowed to share specifics of the Xbox Live functionality with folks Microsoft has confirmed are registered Xbox developers, can you put all this into a ticket for us, so that we can follow up with you privately?

0 Likes 0 ·
Vasil avatar image
Vasil answered

@Brendan Hello, I apologize for my bad English.
I get this error I use GDK.
Can you tell me if I need to confirm access to PlayFab from partner.microsoft ?



LogPlayFab: Response : {"code":400,"status":"BadRequest","error":"InvalidXboxLiveToken","errorCode":1188,"errorMessage":"Client token was not in correct format"}
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.