Visa Developer Community

Highlighted
Regular Contributor

Bad Request 400 Error

av been receiving this error since then am so sruck the error has no description just a web exeption thrown

11 REPLIES 11
Highlighted
Regular Contributor

Re: Bad Request 400 Error

am using a console app not a browser

Highlighted
Visa Dev Moderator

Re: Bad Request 400 Error

Hi @ezamarichard,

 

I'd like to work with you and help you resolve the issue. For starters, can you please make sure you are using the right credentials, such as username and password?

 

In addition to that, the issue could also be caused by the Certificates not being sent with the request. Check File->Settings->SSL Settings and make sure the KeyStore and KeyStore Password are populated in Soap UI. 

 

The Certificate Signing Request is a prerequisite to get your application certificate (cert.pem), which is required to establish a two-way SSL connection. Additionally, you will need a root certificate (VICA-SBX.pem) and your private key.

You have two options to generate a Certificate Signing Request (CSR):

Have Visa generate a CSR for you
Select "generate a CSR from me" when you create a new Visa Developer application. When you select this option, Visa will generate a CSR for you, and you will be prompted to save your private key file when it is downloaded through your browser. Once you save your private key, go to your Visa app page and download your client certificate (cert.pem), as well as your root certificate (VICA-SBX.pem). You will then have everything you need to create a key store.

Generate your own CSR
You can choose to create your own CSR. The Visa Developer Getting Started Guide provides detailed steps on how to generate CSRs: https://developer.visa.com/vdpguide#twowayssl. Please note that you have to fill out all required fields in your Certificate Request. Also, note that the organization name and unit fields do not accept punctuation characters – your CSR will be deemed invalid if you use these characters. Once you have a CSR file, go ahead and create a Visa app, choose "Submit my own CSR", and upload your CSR file. During the CSR creation process, take note of the file containing your private key. Once you upload your CSR, go to your Visa app page, and download your client certificate (cert.pem), as well as your root certificate (VICA-SBX.pem). You will then have everything you need to create a key store.

Continuing to the Key Store
Once you have a private key and two certificate files in your local directory, you will need to combine them into a key store. You can decide whether to use Java Key Store (JKS) or PKCS (P12) key store, depending on what your development environment requires. There are sections in “getting started” ->“Using two-way SSL” (https://developer.visa.com/vdpguide#twowayssl), that describe how to create each type of key store, please follow those steps. Note, that the root certificate is not needed for a P12 file, you can create a P12 file out of two files: private key and cert.pem

 

If you are still getting an error please feel free to contact us and provide the information listed below and please provide more information on the error you have received to Developer@visa.com. Please send the response request of the error received, screenshot and the Correlation ID. Some of this information should be kept private and that's the reason why I'm requesting you email your Correlation ID to Developer@visa.com.


Below are the steps to get the Correlation ID using a Google Chrome browser.

1>Open Chrome menu.
2>Click on More tools then Developer tools.
3>Check the box to Preserve Log for the Network Tab.
4>Then try to click on the add API link.
5>You can find the Correlation ID in the network log for add API call.

 

Please perform these steps and let me know your findings.

 



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Tags (1)
Highlighted
Regular Contributor

Re: Bad Request 400 Error

let me get the correlation id Thanks

i have the p12 key just dont know how to use it instead am using this

public static string cert = Path.Combine(AppDomain.CurrentDomain.BaseDirectory
            .ToString() , "security/cert.pem");
        public static string certPassword = "my password";

could this be where the problem is

thanks

Highlighted
Visa Dev Moderator

Re: Bad Request 400 Error

Hi @ezamarichard,

 

Thanks for the update! I highly suggest you have Visa generate a CSR for you. That's the easiest way to go about getting a CSR, and I think you'll agree once you give it a try. Hope that helps!

 

Have Visa generate a CSR for you
Select "generate a CSR from me" when you create a new Visa Developer application. When you select this option, Visa will generate a CSR for you, and you will be prompted to save your private key file when it is downloaded through your browser. Once you save your private key, go to your Visa app page and download your client certificate (cert.pem), as well as your root certificate (VICA-SBX.pem). You will then have everything you need to create a key store.

 



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Highlighted
Regular Contributor

Re: Bad Request 400 Error

Bad Request can mean to be painful

but if you use this code and get the error description you will start seing error codes and missing parameters that are causing it

 if (e.Response is HttpWebResponse)
               {
                    HttpWebResponse response = (HttpWebResponse)e.Response;
                    statusCode = response.StatusCode.ToString();
                    string desc = response.StatusDescription;
                    using (var reader = new System.IO.StreamReader(response.GetResponseStream(), encoding))
                    {
                        string result = reader.ReadToEnd();
                        statusCode = response.StatusCode.ToString();
                        statusCode = result+"\n"+requestBodyString;
                    }

                }

Cheers

 

Highlighted
Visa Dev Moderator

Re: Bad Request 400 Error

Hi @oxfordtricks,

 

If the issue persists, please send the response request of the error received, screenshot and the Correlation ID. Please let us know if you have other questions.
 
Below are the steps to get the Correlation ID using a Google Chrome browser.
1>Open Chrome menu.
2>Click on More tools then Developer tools.
3>Check the box to Preserve Log for the Network Tab.
4>Click on the error and go to the Headers.
5>You can find the Correlation ID in the network log.

 



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Highlighted
Regular Visitor

Re: Bad Request 400 Error

Try Clearing your cache and cookies of your browser. For instance you can also try changin your browser or internet connection if 

frp bypass apk

Highlighted
Newbie

Re: Bad Request 400 Error

The 400 Bad Request error is an HTTP status code that means that the request you sent to the website server, often something simple like a request to load a web page, was somehow incorrect or corrupted and the server couldn't understand it. you can learn more here and some many sites get this problem so don't they will fix then you will access 

 

Thanks

Tom Jon Self Treatment

Highlighted
Visa Dev Moderator

Re: Bad Request 400 Error

Hello jamespslab,

 

Can you please confirm if you are still experiencing an issue or if the issue is resolved?

 

 

 

 



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana