If you are just getting started with Tesults and have not submitted test results data to Tesults yet and cannot see any results data in the results view, read the integration documentation instead. Once that has been completed, you can use the Tesults API to retrieve results data to make decisions within your continuous integration and deployment pipelines.
Retrieving targets is useful for getting the id and names of all of the targets that belong to a project. When fetching results the id of the target to fetch results for is required.
curl https://www.tesults.com/api/targets
-H "Authorization: Bearer token"
The Authorization header is required for all requests to the Tesults API. See the authentication documentation for details.
Name | Value |
---|---|
limit (optional) | A number (minimum value 1) to limit the number of targets returned. If no limit is supplied the default limit is 100. |
cursor (optional) | Pagination parameter. If a cursor is returned in the response data from a request that means more data is available. Add the value of the cursor returned in the response in the next request to retrieve the next set of data. |
Successful response:
{
"data"
: {
"code":200
,
"message":"Success"
,
"targets": [
{
"id":<id>
,
"name":<name>
,
...
}
],
"cursor":<cursor>
}
}
Failure response:
{
"error"
: {
"code":401
,
"message":"Unauthorized"
,
}
}
Successful responses return JSON containing a data property. Error responses return JSON containing an error property. Both data and error values contain a code and message property, specifying the http status code and a message containing additional context.
Successful responses also contain additional properties within data. The response includes an array of targets and cursor for pagination use if there is additional data available (more targets) to retrieve.
Create a new target.
curl -X POST -d '{"name": "New target name"}'
-H "Content-Type: application/json"
-H "Authorization: Bearer token"
https://www.tesults.com/api/targets
Note that projects on the Free plan are limited to 5 targets in total and this limit cannot be increased. Projects on Standard and Plus plans are limited to 100 targets in total by default but you can have this limit raised, at no additional cost, by contacting help@tesults.com.
curl -X POST -d '{
"name": "Target name",
"description": "Target description",
"group": ["Group A", "Group B"],
"public": false,
"build_consolidation": false,
"build_replacement": false,
"rawResultMap": 1664195396156
}'
-H "Content-Type: application/json"
-H "Authorization: Bearer token"
https://www.tesults.com/api/targets
The Authorization header is required for all requests to the Tesults API. See the authentication documentation for details.
Name | Value |
---|---|
name | Name of the new target. |
description (optional) | A description of the new target. Useful for providing additional information about the target. |
group (optional) | Set target group. Pass through an array of strings containing group names, a target can belong to multiple groups. Must contain at least one group. |
public (optional) | Set true to set privacy to public and false for private for the target. If set to public this only takes effect if both the organization and project are also set to public by an administrator. |
build_consolidation (optional) | Set true if want to enable build consolidation for this target. |
build_replacement (optional) | Set true if want to enable build replacement for this target. |
rawResultMap (optional) | Set the id of the result interpretation map to use with this target. |
Successful response:
{
"data"
: {
"code":200
,
"message":"Success"
,
"target": {
"id":<id>
,
"name":<name>
,
...
},
"token":<token>
}
}
Failure response:
{
"error"
: {
"code":401
,
"message":"Unauthorized"
,
}
}
Successful responses return JSON containing a data property. Error responses return JSON containing an error property. Both data and error values contain a code and message property, specifying the http status code and a message containing additional context.
Successful responses also contain additional properties within data. The response includes the newly created target and the target token to use for uploading results data. This is the only time the token is transmitted so you must save it, if lost the token can be regenerated using the regeneration API.
Regenerate a target token. Tokens are required for uploading results data.
curl -X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer token"
https://www.tesults.com/api/
targets/:target/regenerate_token
The Authorization header is required for all requests to the Tesults API. See the authentication documentation for details.
Replace :target with the target id of the target for which to regenerate a token.
Name | Value |
---|
Successful response:
{
"data"
: {
"code":200
,
"message":"Success"
,
"target": {
"id":<id>
,
"name":<name>
...
},
"token":<token>
}
}
Failure response:
{
"error"
: {
"code":401
,
"message":"Unauthorized"
,
}
}
Successful responses return JSON containing a data property. Error responses return JSON containing an error property. Both data and error values contain a code and message property, specifying the http status code and a message containing additional context.
Successful responses also contain additional properties within data. The response includes the target for which the token has been regenerated and the token itself.
Update target properties.
curl -X POST -d '{"name": "New target name"}'
-H "Content-Type: application/json"
-H "Authorization: Bearer token"
https://www.tesults.com/api/targets/:target
curl -X POST -d '{
"name": "Target name",
"description": "Target description",
"group": ["Group A", "Group B"],
"public": false,
"build_consolidation": false,
"build_replacement": false,
"rawResultMap": 1664195396156
}'
-H "Content-Type: application/json"
-H "Authorization: Bearer token"
https://www.tesults.com/api/targets/:target
The Authorization header is required for all requests to the Tesults API. See the authentication documentation for details.
Name | Value |
---|---|
name (optional) | Name of the target. |
description (optional) | A description of the target. Useful for providing additional information about the target. |
group (optional) | Set target group. Pass through an array of strings containing group names, a target can belong to multiple groups. . Must contain at least one group. |
public (optional) | Set true to set privacy to public and false for private for the target. If set to public this only takes effect if both the organization and project are also set to public by an administrator. |
build_consolidation (optional) | Set true if want to enable build consolidation for this target. |
build_replacement (optional) | Set true if want to enable build replacement for this target. |
rawResultMap (optional) | Set the id of the result interpretation map to use with this target. |
Successful response:
{
"data"
: {
"code":200
,
"message":"Success"
,
"target": {
"id":<id>
,
"name":<name>
,
...
}
}
}
Failure response:
{
"error"
: {
"code":401
,
"message":"Unauthorized"
,
}
}
Successful responses return JSON containing a data property. Error responses return JSON containing an error property. Both data and error values contain a code and message property, specifying the http status code and a message containing additional context.
Successful responses also contain additional properties within data. The response includes the updated target.
Delete a target including the test runs and all test case data for the target.
curl -X DELETE
-H "Content-Type: application/json"
-H "Authorization: Bearer token"
https://www.tesults.com/api/targets/:target
The Authorization header is required for all requests to the Tesults API. See the authentication documentation for details.
Replace :target with the target id of the target to be deleted.
Name | Value |
---|
Successful response:
{
"data"
: {
"code":200
,
"message":"Success"
,
}
}
Failure response:
{
"error"
: {
"code":401
,
"message":"Unauthorized"
,
}
}
Successful responses return JSON containing a data property. Error responses return JSON containing an error property. Both data and error values contain a code and message property, specifying the http status code and a message containing additional context.