Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Fetching Test case detail using JAVA API



I tried fetching a test case detail using JAVA API, but couldn’t fetch it. Initially it asked me to add the required certificates. I added that. After that it started giving 401 error. I even tried curl command as described in this link - I added “-k” to the curl command and ran it and the result was same. The error that i received is present below:

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn’t understand how to supply the credentials required.

The curl command:-
curl -k -H “Content-Type: application/json” -u “username:passsword” “https:///testrail/index.php?/api/v2/get_case/1”

Please let me know where I’m going wrong.


Hi Arun,

Thanks for your posting! It looks like you are using a local TestRail installation on your own server, is this correct? Could you please check if your server requires an additional authentication step (such as HTTP basic auth in front of TestRail)? We are happy to look into this if you could send the full curl request including response to our help desk at (please add the -v switch to the curl command for more details).