Quickstart for Testiny REST API
Learn how to get started with Testiny's REST API.
Getting started using curl
- Check if curl is installed on your machine by executing
curl --version
in the command line. If you see the version, it is installed. If not, you need to install curl. See the curl download page for more information. - To authenticate, you need to specify an API key in your request. If don't have a Testiny API key yet, see our documentation on how to create an API key.
Treat the API key like a password and keep it safe.
- You can use the following curl command to get all projects in your Testiny account. You just have to replace
<API_KEY_VALUE>
with your API key.
- Linux
- Windows
curl -L -X GET 'https://app.testiny.io/api/v1/project' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <API_KEY_VALUE>'
curl -L -X GET "https://app.testiny.io/api/v1/project" ^
-H "Accept: application/json" ^
-H "X-Api-Key: <API_KEY_VALUE>"
As well as retrieving data, you can also add or update entities. Note that POST and PUT requests require a body. The body can be passed with
--data-raw
.The following example shows how to set the result of a test case in a test run. To achieve this, we want to update the testrun-testcase mapping and set the entities to
testcase:testrun
and define an update operation withop=update
. The Testiny REST API offers the following operations for mappings: add, delete, update, add_or_update.In the body we define which test case in which test run we want to update. In this example, we update the test case with ID 1234 in test run with ID 3 and set the
result_status
toPASSED.
Possible values for the result are "NOTRUN", "PASSED", "FAILED", "BLOCKED", "SKIPPED".For more information on this particular API call, see its description.
- Linux
- Windows
curl -L -X POST 'https://app.testiny.io/api/v1/testrun/mapping/bulk/testcase:testrun?op=update' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: <API_KEY_VALUE>' \
--data-raw '[{
"ids": { "testcase_id": 1234, "testrun_id": 3 },
"mapped": { "result_status": "PASSED" }
}]'
curl -L -X POST "https://app.testiny.io/api/v1/testrun/mapping/bulk/testcase:testrun?op=update" ^
-H "Content-Type: application/json" ^
-H "X-Api-Key: <API_KEY_VALUE>" ^
--data-raw "[{\"ids\": {\"testcase_id\": 1234,\"testrun_id\": 3},\"mapped\": {\"result_status\":\"PASSED\"}}]"