Error importing postman collection

Hi team, I recently came across akto and trying to locally test it. While importing my postman collection it analyzes the file and gives me the following error”error while replaying request(query) java lang exception: found non 2xx response on replaying the api”. I am new to api’s and testing. Am i missing something? I did sent a few requests in postman and got 200 ok’s but not sure what i am missing. Please help.

Hi @Rahulp,

It looks like you’re encountering a common issue where Akto is not able to get a successful response when trying to replay requests from your imported Postman collection. Here’s a more refined explanation and some steps you can take to resolve this:

Akto needs both request and response data to build its API inventory accurately. If it doesn’t find response data in your Postman collection, it attempts to replay the requests to generate this data. The error you’re seeing, “found non 2xx response on replaying the API,” indicates that Akto is receiving responses other than the successful 2xx HTTP status codes (like 200 OK) during this replay process. This could be due to a variety of reasons such as incorrect endpoint URLs, authentication issues, or other misconfigurations.

Here are a couple of methods to troubleshoot and fix the issue:

  1. Ensure Responses Are Included in Your Postman Collection: When saving requests in Postman, also save the corresponding responses. You can do this by:

    • Making a request in Postman.
    • Once you receive a successful response (like 200 OK), save the request-response pair in your collection.
    • Export this collection as a .json file and then import it into Akto.
  2. Verify All Request Details Are Correct: Before exporting your Postman collection, double-check that all requests include the necessary information like:

    • Correct endpoint URLs.
    • Required headers (for example, Content-Type, Authorization tokens).
    • Any other necessary parameters or body data.

By following these steps, you should be able to ensure that Akto has the complete and correct data it needs to replay requests successfully. If the problem persists, you might want to check the network settings or contact Akto support for more specific assistance related to your setup.