Examples of requests#
The page contains the examples for:
Run a test#
To run a test, run the command:
curl --location --request POST 'https://api.platform.io/test-srv/api/test' \
--header 'api-token: API token' \
--header 'Content-Type: application/json' \
--data-raw '{
"testProjectId": 3,
"testProjectVersionId": 47,
"comment": "",
"inheritLabelsFromProject": true
}'
Note
This example is for Mac/Linux systems. If you are using a Windows system, replace all single quotes with double quotes.
Parameters of a request:
api-token. The API token.
testProjectId. The ID of the test. To find the ID, follow these steps:
Go to the Tests page.
Select the test. The test ID is displayed in the address bar:
testProjectVersionId. The ID of the test’s version. If the parameter isn’t specified, a the latest test’s version will run. To find the version, follow these steps:
Go to the Test run page.
Select the test run.
Click Test. The ID of the test’s version is displayed in the address bar:
comment. Comments on the test.
inheritLabelsFromProject. If true, labels are copied from a test to a test run.
Get SLA results#
To get SLA results, run the command:
curl --location --request GET 'https://api.platform.io/test-srv/api/testResult/sla?testId=357' \
--header 'api-token: API token'
Note
This example is for Mac/Linux systems. If you are using a Windows system, replace all single quotes with double quotes.
Parameters of a request:
testId. The test run ID. To find the test run ID, use one of the following methods:
Send the request for running a test. The ID is included in the response in the id property.
Find it in the address bar:
Go to the Test run page.
Select the test run. The test run ID is displayed in the address bar:
api-token. The API token.