TestRail API is disabled for your installation (error)

TestRail API is disabled for your installation (error)

Problem:

I tried calling the TestRail API to retrieve a case through the REST API. This is my curl command used:

C:\Users\ahmed> curl -H "Content-Type: application/json" -u "ahmed@revelationtech.com:16JQ1MTMMsEQl4wIeCp" "https://ahmedttt.testrail.io/index.php?/api/v2/get_case/1"

The error received in the JSON response was:

{"error":"The API is disabled for your installation. It can be enabled in the administration area in TestRail under Administration > Site Settings > API."}

Solution:

  1. On the TestRail console, click on Administration.
  2. Click on Site Settings.
  3. Click on API.
  4. Check "Enable API" and click on Save settings.