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

TestRail - API - Post JSON data is ignored


#1

Hi team,

I am trying to use TestRail (5.4.0.3659) APIs to perform basic CRU operations. I am able to do a read operation . but unable to do Create and Update Operation.
I suspect the JSON Data that I sent as part of request is not reaching the API Service . is this correct ?
Any help where it is going wrong and why POST JSON data not reaching the TestRail API service.

GET – Working Fine . Able to get the test plan details in response.

curl --insecure -L -H “Content-Type: application/json” -u "testrail-service@xxx.com:Pwd2017" “https://testrail.xxxx.com:20202/testrail/api/v2/get_plan/24

POST - Create a Test plan – Not Working . The data (Name ) sent ignored. Error stating “Required Field: name” is missing.

curl --insecure -L -d ‘{“name”:“TestPlan-A”}’ -H “Content-Type: application/json” -u "testrail-service@xxx.com:Pwd2017" -X POST “https://testrail.xxxx.com:20202/testrail/api/v2/add_plan/25

POST – Update a Test Plan – Not working. The data (update name attribute) sent is ignored . No error thrown because json data is optional.


#2

Solved . The API PHP Url is incorrect (should the documentation be updated ?) .

Incorrect : https://testrail.xxxx.com:20202/testrail/api/v2/add_plan/25
Correct : https://testrail.xxxx.com:20202/api.php?/api/v2/add_plan/25


#3

Send the info into the Support email address, best chance they will see it and change it if needed.


#4

Links are not valid.


#5

The links are to their TR install - they should not work and if they do and you can get into them, there would be a VERY serious security issue.