Solution to Error 400 when using LiveScan API

Created by Juan Manuel Libera Frómeta, Modified on Sun, 03 Sep 2023 at 05:52 PM by Juan Manuel Libera Frómeta

Summary of the problem

A customer reported receiving a 400 (Bad Request) error when trying to use the InsecureWeb LiveScan API to scan the domain "cybersafehaven.com" using Postman.

Root cause

The error is due to the customer placing quotation marks around the "field" and "search" parameters in the API request URL, which is unnecessary and causes a 400 error.

Solution

To resolve this problem, simply remove the quotation marks around the parameters in the request URL:


https://app.insecureweb.com/api/organizations/live-scan?field=domain&search=cybersafehaven.com

The values for the "field" and "search" parameters should not be in quotes in this case.

Technical explanation

APIs expect parameters to be passed in a specific format. Adding quotation marks around simple text values can cause the API to fail to interpret them correctly.

Since "field" and "search" are parameters that only require a text value, the extra quotation marks cause a 400 bad request error.

Conclusion

It is important to carefully review API documentation and pass parameters exactly in the expected format. Syntax errors like extra quotation marks can be avoided by following the guidelines to the letter.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article