Examples of requests#

STANDARD PRO

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 project. To find the ID, follow these steps:

    1. Go to the Projects page.

    2. Select the project. The ID of the test project is displayed in the address bar:

      ../_images/um_api_testProjectId.png
  • testProjectVersionId. The version of the test project. If the parameter is not specified, a test for the latest version of the project will run. To find the version, follow these steps:

    1. Go to the All tests page.

    2. Select the test.

    3. Click Test project. The version of the test project is displayed in the address bar.

      ../_images/um_api_testProjectVersionId.png
  • comment. Comments on the test.

  • inheritLabelsFromProject. If true, labels are copied from a project to a new test.

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 ID. To find the test 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:

      1. Go to the All tests page.

      2. Select the test. The test ID is displayed in the address bar:

      ../_images/um_api_testId.png
  • api-token. The API token.