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

Why not return 'section_id' instead of 'id' from 'get_sections'?

’ get_sections’ response content is like that:
[
{
“depth”: 0,
“display_order”: 1,
“id”: 1,
“name”: “Prerequisites”,
“parent_id”: null,
“suite_id”: 1
},

]

Then, if you want to add a new case, you can use
POST index.php?/api/v2/add_case/:section_id

In this case, ‘section_id’ is basically the ‘id’ from ‘get_sections’, right?
If this is correct, then why not change the name in response content to be ‘section_id’ instead of ‘id’?
Thank you.

Hi @Adrian,

Tanks for the post! The ‘id’ field returned by API responses would represent the ID of the entity type you are interacting with. This is consistent throughout TestRail’s API. For example, if you use the ‘get_case’ API method, you will see an ‘id’ field which represents the case_id.

That being said, we do understand how changing these field names could help some users and I will add your feedback for improvements to TestRail’s API.

Please let us know if you have any additional questions or feedback.

Regards,
Jon

Thank you Jon for your quick and detailed response. No others questions for now :slight_smile:

Regards,
Adrian

Hi Jon,

Actually, if you don’t mind, I have a follow up question regarding this topic.
After create test suite, there are no test cases.
image

To add a new test case, you need first to add a Section? Because if I try to add a case, I need to know section_id, which is not available yet. Or what do I miss here?

Regards,
Adrian