Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
In our Technical Documentation the required information when working with the Testify API is listed.
The Testify API can be used to query information from Testify, but also to create and update information. With help of the Testify API it is easily possible to connect Testify to your own systems and exchange information in an automated way. Testify Webhooks can be used to respond on events that occur in Testify in an automated way (more information below).
The Testify API is a REST API which can be accessed via authenticated HTTP requests (using an API key). The documentation with all available endpoints can be found at https://cloud.testify.io/core/services/swagger/index.html and it is recommended to use the most recent version, which at the moment of writing this documentation is Testify API v3.0. Note that as of now all listed versions are supported, but it is not recommended to any other than v3.0 as the older versions might get deprecated in the future.
Fundamentals
HTTP Methods
With GET requests the details of an entity can be queried.
A POST request method is used when a new entity should be created and the data is sent as JSON in the request body.
The PATCH endpoints can be used to update single properties of an existing entity.
If a property is included in the JSON request body, it's value should be updated with the value from the JSON. All other properties that are not included will stay the same as before. To delete an optional property value this can be done by setting the property in the JSON to NULL.
For properties that contain lists, NULL and an empty array both will mean the list will be emptied after the update. If you want to update a list you have to provide the complete list of entries again that should be set after the update operation.
Path Parameter vs. Query Parameter
The Parameters section in swagger shows the type of the parameter.
all following query parameters are appended starting with an &
Here also the three mandatory authentication HTTP headers are listed, for details see below section (Authentication).
Versioning
A version of the API contains a certain set of attributes, it is ensured that these are always available, the name of the attribute does not change and no new mandatory attributes are added in the same version. New optional fields are allowed, which can also affect the order of attributes.
Every HTTP request must contain the API version 3.0 as query parameter e.g. ?api-version=3.0 or ?<other-parameter=value>&api-version=3.0
StageBaseUrl
The StageBaseUrl can differ and must be adapted in the request URL (and also in the Swagger UI URL) if a private stage is used. All examples in this documentation use https://cloud.testify.io as StageBaseUrl and assume that the Testify stage is used.
Id, ExternalId, Identifier in Testify Public API v3
Id: Internal Testify id (required, unique, guid-format)
ExternalId: Third-party-system id (optional, unique)
Identifier: Professional id (unique, human-readable)
Each entity in Testify has an (internal) id which is globally unique in the format of “00000000-0000-0000-0000-000000000000“ which is always automatically generated by the system itself if not set explicitly.
Some entities namely testobjects, testobject-types, checklists, checklist templates, checks, testequipments, testequipment-types, customfields, issue categories, groups and users additionally have an optional, unique ExternalId, which can be used for correlating to entities in another system. For example, when testobjects are synced from an ERP system, the IDs of the ERP system can be used as the ExternalId in Testify. This will make it easy later on to find the correlating test object for an entity in your ERP system by just doing an ID lookup. When creating an object without providing an externalId, it automatically gets set to the value of the internal Id.
Many entities namely testobjects, checks, testequipments, customfields and groups have an identifier property which can be used as professional unique identification of the object.
E.g. id: 9033d3c6-5897-484c-a247-61cc4e636920, externalId: sap-object-1 , identifier: my-testobject-1
Testify entities
Checklist Template: Defines the structure of a checklist with its pages, sections and checks.
Checklist Instance: Is an instance of a checklist template which is assigned to a certain user or group and where check results are added. A checklist instance can be created from a published checklist template.
Check & Check Result : A checklist can contain 13 different check types of checks with different parameters and result values. Adding a check result is only possible for following kinds of check types:
Check Type
Add Check Result
Check Type
Add Check Result
Calculation
Date
FileUpload
GeoPosition
Logical
MultipleChoice
Numeric
Photo
Signature
SingleChoice
TestObjectSelection
Text
Time
Issue & IssueCategory & IssueSeverity: An issue must be categorized and must have a severtiy.
TestEquipment & TestEquipmentType: A testequipment is a tool that is used when executing a check and it is categorized by a test equipment type.
TestObject & TestObjectType: A testobject can be linked to a checklist instance or an issue and it is categorized by a test object type.
Authentication
To access the Testify API a Testify user with a valid API key is needed. This API key must then be sent in every requests header.
Please be aware that a user in Testify has roles and permissions and is allowed to make certain requests based on that. An API key is always generated for a certain Testify user and when making a request with an API key the permissions of that user are used. Therefore, it is advised to create an own Interface User that has all roles and permissions needed for accessing the endpoints.
Go to “Administration” → “Users” and create a new Interface User with a self defined password and all roles assigned.
Within the User’s Profile, click on the context menu and select “Generate API key”.
Note the API key that consists of secret, Subject and Tenant.
Please be aware that this API key can only be viewed once and must be regenerated otherwise. Regenerating means disabling the previous used API key.
Authenticate with API Key
Place secret, Subject and Tenant in request header.
Pagination
All /search endpoints have a mandatory top(integer) property, an optional skip(integer) property and an optional count(boolean) property in their request body.
The top property must be set to a maximum value of 80 and defines the number of elements that get sent in the response.
The skip property can be set and defines the number of elements that should be skipped.
The count property is a boolean flag which tells if the count of all elements the sent back in the response. It should be set to true when trying to query all elements and can be then used to query all the elements in batches.
Request
Response
Request
Response
Number of Request
Top
Skip
Count
Value
Count
1.
80
0
true
First 80 elements
200
2.
80
80
true
Second 80 elements
200
3.
40
160
true
Last 40 elements
200
Checklist Template Creation
A checklist template defines the structure of a checklist with its pages, sections and checks. In Testify there is a revisioning mechanism for checklist templates, and these checklist template revisions can be in different states (Draft, Published, Disabled).
When the “id” or “externalId” of an already existing checklist template is set, only a new checklist template revision will be created according to the given “state”.
When no checklist template exists, a new checklist template with it´s associated checklist template revision will be created.
Webhooks allow you to respond on events that occur in Testify in an automated way, without the need to make requests repeatedly. To use webhooks a HTTP server where Testify is allowed to send POST requests is needed. When this is available, it can be easily configured within Testify on what events should be reacted to and to which URL the request should be sent to.
How to define a webhook within Testify
As logged in User go to “Administration” → “Workflows” and create a new Workflow.
Define a Name.
Define an Event.
Define an Action with scope “Webhook” and type “trigger”.
Click on “Parameters” and provide the URL of the webhook that should be called and can be accessed by Testify via POST request. As an optional parameter, an Identifier can be specified, which then will be sent in the request body. Also, the request timeout and the HTTP status codes that indicate success can be customized, as well as some authorization options containing of a secret and HTTP headers. Please consider that Content-Type: application/json and Content-Length HTTP headers are set implicitly as default by Testify and can't be added here.
Save newly created workflow, which then automatically gets invoked when the specified event occurs.
To see when a webhook has been executed and whether the execution has been successful, go to the workflow details, click on the context menu and select “History”.
Samples of what information will be sent in the webhook payload
The HTTP method is always POST and the payload depends on the event that triggered the webhook.
Property
Description
Property
Description
WebHookIdentifier
This is set to the identifier that can be set as an optional parameter at the webhook configuration (see above).
IssueFilter, ChecklistFilter, TestObjectFilter, PdfFilter, UserFilter, or TimerFilter
Depending on the event that triggered the workflow these are set.
TriggeredByWorkflowId
Id of the workflow that triggered the event. Only set if the event was triggered by a workflow.
TenantId
Id of the tenant.
EntityType
Gives information about the event that triggered the webhook: 1 (issue), 2 (checklist), 3 (testobject), 4 (pdf), 5 (user), or 6 (timertrigger).
Action
Tells whether 1 (created) or 2 (updated) triggered the webhook.
In our case a checklist has been created, so 1 is set.
ChangedValues
Only set if the triggering event is an update event. Shows the values that were changed in this update.
EntityId
External Id of the object that triggered the webhook.
In our case this is the external id of the created checklist.
EntityUrl
URL where details of the object that triggered the webhook can be found.
In our case the created checklist can be queried via GET-request to this URL.
As mentioned above additional parameters for sending authenticated webhook requests can be specified in the webhook “Parameters”. So the target of the webhook is able to verify the integrity of an incoming webhook request. This is possible by 2 differnt mechanisms:
Adding arbitrary HTTP-Headers: This consists of key-value pairs which are then sent in the HTTP headers, e.g. Username: {Username}, Password: {Password}. Please be aware that this should only be done when using a secure channel like HTTPS, TLS.
Signing the webhook request with a pre-shared secret: This adds the following two additional HTTP headers to the webhook request - Testify-Webhook-Signature and Testify-Webhook-Signature-Timestamp. The Testify-Webhook-Signature is a hashed value, which is created from a timestamp and the request payload by using SHA256 HMAC with the provided “secret” in the webhook parameters and then base64 encoding. Represented as: base64(HMACSHA256(TIMESTAMP + BODY)) To verify the signature, create the same SHA256 HMAC signature (containing of the Testify-Webhook-Signature-Timestamp and the request payload) with the provided secret, then base64 encoding and compare it to the Testify-Webhook-Signature sent in the request header. See following example:
public bool VerifyWebhook([FromBody] object body)
{
var secret = "my-secret";
var signature = this.Request.Headers.GetValues("Testify-Webhook-Signature").FirstOrDefault();
var timestamp = this.Request.Headers.GetValues("Testify-Webhook-Signature-Timestamp").FirstOrDefault();
var parsedBody = JsonConvert.SerializeObject(body);
using (var hmac = new HMACSHA256(Encoding.ASCII.GetBytes(secret)))
{
var encodedSignature = Convert.ToBase64String(
hmac.ComputeHash(
Encoding.ASCII.GetBytes($"{timestamp}{parsedBody}")));
return signature == encodedSignature;
}
}
Public API v2
External vs. Internal ID in Testify Public API v2
Many entities in Testify namely checklist templates, checklist instances, testobjects, testobject-types testequipments, testequipment-types, customfields, issue categories, groups and users have an external and an internal ID. The internal id must be a globally unique identifier in the format of “00000000-0000-0000-0000-000000000000“, whereas the external id can be in a format more readable for humans to better recognize the object and must also be unique.
E.g. internal id: 9033d3c6-5897-484c-a247-61cc4e636920, external id: my-testobject
Users can choose an external ID to make it easy to correlate the entities to entities in other systems. For example, when testobjects are synced with an ERP system, you could reuse the IDs of the ERP system and set the external IDs in testify with that value. That will make it easy later on to find the correlationg test object for an entity in your ERP system by just doing an ID lookup.
Where does the Testify Public API v2 use External IDs?
In General, all IDs used by the Testify Public API v2 are external IDs.
What happens when no External ID is provided when creating objects?
An internal ID is always automatically generated by the system itself. The external ID can be chosen when creating the entity via the API v2 by just assigning a value to the ID property. This value has to be unique, though. When creating an object without providing an external ID, it automatically gets set to the value of the generated internal ID.
Webhooks - Example of a complete use case using Public API v2
This example shows a complete use case using Testify API v2. First a testobject is created and for this testobject a checklist is instantiated. When the checklist is completed in Testify two webhooks are called, one that fetches the check results and one that informs us about a generated PDF for that checklist and downloads it.
HTTP headers: API key (secret, Subject, Tenant), Content-Type: application/json, Content-Length
Payload (approach 1): Both the internal id and the external id are automatically set by the system and are the same.
{
"testObjectTypeId": "F4BBD5AA-7F27-4D9E-976C-23AB258A21B9",
"title": "My new testobject",
"identifier": "my-new-testobject",
"description": "testobject created by api",
"parentId": null
}
OR Payload (approach 2) including self-assigned external id: The external id is set to my-testobject and the internal id is automatically set by the system.
{
"testObjectTypeId": "F4BBD5AA-7F27-4D9E-976C-23AB258A21B9",
"title": "My new testobject",
"identifier": "my-new-testobject",
"description": "testobject created by api",
"parentId": null,
"id": "my-testobject"
}
Testobject has successfully been created if response has statuscode 200 OK and payload contains external id of new testobject. If response statuscode is 400 Bad Request something in the request is wrong, but error details are provided in the payload.
Instantiate checklist for newly created testobject via Testify API v2:
Checklist has successfully been started when response has statuscode 200 OK and payload contains external id of new checklist instance. If response statuscode is 400 Bad Request something in the request is wrong, but error details are provided in the payload.
React to webhook informing us of completed checklist and fetch check results:
Prerequisites 1 - Before completing the checklist: Configure webhook that should be triggered (see above). Event details: Scope: “Checklist”, Type: “updated”, Triggers: State = “Done” Action details: Scope “Webhook”, Type: “trigger”, provide URL
Parse Webhook payload:
ChangedValues shows state change from 0 (open) to 3 (done) and new modifiedAt date.
EntityId is needed to fetch the checklist results.
The response should have status code 200 OK and gives details of the checklist instance with all testcases. Details to this response can be found below at “Structure of checklist results” section.
React to webhook informing us of generated PDF for checklist and download it:
Prerequisites 1 - Before completing the checklist: Configure workflow that automatically generates PDF. Event details: Scope: “Checklist”, Type: “updated”, Triggers: State = “Done” Action details: Scope: “PDF”, Type: “generate”, select PDF protocol profile and language
Prerequisites 2 - Before completing the checklist: Configure webhook that should be triggered. Event details: Scope: “PDF”, Type: “Checklist PDF generated” Action details: Scope “Webhook”, Type: “trigger”, provide URL
Send GET-Request to get created PDF and download it:
Endpoint: EntityUrl
HTTP method: GET
HTTP headers: no headers
Payload: no payload
The response should have status code 200 OK and gives the created PDF as payload.
Localization
All localizations implemented in Testify can also be used in the Testify API v2. Every tenant has a default language which normally is English (US). Following languages are available:
Iso-Code
Title
Iso-Code
Title
bs
Bosanski
de-AT
Deutsch
en-GB
English (UK)
en-IN
English (India)
en-US
English (US)
es-MX
Español
fr
Français
nl
Nederlands
pt-BR
Português
ru
русский
zh-CN
中文(中国)
zh-TW
中文(台灣)
Example for creating a custom field with a title in multiple languages
Checklist Template: Defines the structure of a checklist with its pages, sections and checks.
Checklist Template Revision: Is a revisioning mechanism for checklist templates. A checklist template revision can be in different states (see Enumeration types below).
Checklist Instance: Is an instance of a checklist template which is assigned to a certain user or group and where check results are added. A checklist instance can be created from a checklist template´s current (published) revision.
Check(Testcase): A checklist can contain 11 different types of checks with different parameters and result values (see details below).
Enumeration types
Many endpoints use enumeration types in their request or response body. In the Testify API v2 they are represented by their integer value. Some important examples are listed below:
List of Check Types (TestCase Plugins) with result and parameter structure
The result type always refers to the TestCase Result Value Typeand the parameter type always refers to TestCase Plugin Parameter Type (see above, with examples about how the value can look like)
Testify offers 13 different check types (internally called TestCase Plugins). The different check types contain different types of data which are described in this section.
There are two endpoints where check results can be added. They differ in whether the checkId or the checkIdentifier ist set. Both - checkId and checkIdentifier- can be queried at the GET /public/checklists/{externalId}/results/flat endpoint. (which is described above)
POST /public/checklists/checkresult: Add check result by checkId.
POST /public/checklists/checkresult/identifier: Add check result by human-readable checkIdentifier.