question

Jonathan Wetherall avatar image
Jonathan Wetherall asked

400 Error on Unity and Switch,400 Bad Request error on Switch and Unity

I am getting /Client/LoginWithNintendoServiceAccount : HTTP/1.1 400 Bad Request, my app is

Title ID
5DA52
As far as i can see i have correctly followed all the information i can find, though a good example would really save time instead of having to scrape information from the Nintendo forums. Jon,

I am getting /Client/LoginWithNintendoServiceAccount : HTTP/1.1 400 Bad Request, my app is

Title ID
5DA52
As far as i can see i have correctly followed all the information i can find, though a good example would really save time instead of having to scrape information from the Nintendo forums.Jon
10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

Firstly, the error “HTTP/1.1 400 Bad Request” is a common API error. It cannot be used to locate a specific issue. You can print its error messages for more detailed information. The request and its callback functions could be something like this.

using PlayFab;
using PlayFab.ClientModels;
using UnityEngine;


public class LoginWithNSAccount : MonoBehaviour
{
    public void Start()
    {
        var request = new LoginWithNintendoServiceAccountRequest { IdentityToken = "[YourIdentityToken]", TitleId = "[YourTitleId]" };
        PlayFabClientAPI.LoginWithNintendoServiceAccount(request, OnLoginSuccess, OnLoginFailure);
    }


    private void OnLoginSuccess(LoginResult result)
    {
        Debug.Log("Success.");
    }


    private void OnLoginFailure(PlayFabError error)
    {
        Debug.Log(error.GenerateErrorReport());
    }
}

Besides, we are not allowed to discuss the development details of the closed game platforms publicly, such as Nintendo Switch, PlayStation, etc. If the issue is on the content of IdentityToken, you still need to submit the questions on the Nintendo private developer forum for help.

10 |1200

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

fostercarly avatar image
fostercarly answered

The 400 (Bad Request) status code indicates that the server cannot or will not process the request because the received syntax is invalid, nonsensical, or exceeds some limitation on what the server is willing to process. It means that the request itself has somehow incorrect or corrupted and the server couldn't understand it. The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method . Therefore, it prevents the website from being properly displayed. The main thing to understand is that the 400 Bad Request error is a client-side error.

The cause of 400 Bad Request error can be a wrongly written URL or a URL that contains unrecognizable characters. Another cause of the error might be an invalid or expired cookie. Also, if you try to upload a file that's too large. If the server is programmed with a file size limit, then you might encounter a 400 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.

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.