API of Allure TestOps

API of Allure TestOps

The description if all the API methods available in Allure TestOps can be found by accessing the following URL: <TESTOPS>/swagger-ui.html

Limitations

All the API methods described could be used in your applications to retrieve, manage the information in Allure TestOps.

There is one exception – the upload of the test results. Upload of the tests results is a proprietary workflow which could be changed any time without any notice and without any support from our side.

There is only safe and proper way to upload test results to Allure TestOps – using the tools developed by Qameta Software; these are especially designed for this purpose – CI plug-ins (e.g. Allure TestOps Jenkins plug-in), or allurectl which will always support correct workflow and will guarantee the system’s performance won’t degrade.

Swagger page

Swagger section of Allure TestOps has two main sections dedicated to API of i) report service, ii) uaa service.

two services

API or report service

API of report service is needed to create, manage retrieve the data related to your tests:

  • test cases
  • test results
  • launches
  • statistics
  • etc.

API of uaa service

API of report service is needed to create, manage retrieve the data related to Allure TestOps users, license

Try it out

You can try out the API methods right in Swagger UI.

two services

Swagger UI will show you the curl string which was used, all the parameters and will show the results of API method execution.

Authentication

When developing your own integration using one of the programming languages, you need to be authenticated in Allure TestOps to be able to call API methods.

The authentication is done using of API token which you need to generate in your profile.

When the API token is created you need to use it as in example below:

export ENDPOINT="http://localhost:8080"
export API_TOKEN="78e5e1bb-6329-483e-9b34-39fb223b19a1"
export PROJECT_ID=1
export AQL='true'
echo "Getting information about failed tests"
curl -s -G "${ENDPOINT}/api/rs/testcase/__search" \
     --header "Accept: application/json" \
     --header "Authorization: Api-Token ${API_TOKEN}" \
     --data-urlencode "projectId=${PROJECT_ID}" \
     --data-urlencode "rql=${AQL}" \
     --data-urlencode "page=0" \
     --data-urlencode "size=1"

This means the header --header "Authorization: Api-Token ${API_TOKEN}" is to be added to each request you send to Allure TestOps.

If you require an help with the usage of API, please ask our team responsible for clients’ happiness for assistance.