NAV

PractiTest API V2

Welcome to the PractiTest’s REST API V2!

The REST API is designed for developers who want to integrate PractiTest into their application, synchronize issue trackers or develop any other tool integration with PractiTest. The API also enables organizations to update their automated test results into PractiTest.

We have language bindings in Shell, Ruby, Python, Java and C#! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

JSON API

All along this api we’ve embraced JSON API standards, for share conventions and to save you (and us) precious time.

API rate limit

PT has active policies that limit the number of API calls that can be made per minute by each account.

If an account performs more than 30 API calls in a single minute you will get an error indicating this issue. The error will stop any further calls from reaching the server during that minute, but once the minute passes, you will be able to continue sending calls, there is nothing else that needs to be done (other than solving the the problem of multiple / parallel API calls ).

The idea behind this policy is to help users detect possible issues where the API is being implemented incorrectly, as well as to limit potential disruptions to our service due to this type of incorrect API implementations.

If you have any reason to believe that you need a higher rate limit, please contact our support.

A small note about API V2 vs V1

As of December 31st, 2017, API V1 is depreciated. We wrote the API V2 based on our experience from V1, trying to make it simpler and more robust.

We changed many things from V1:

Code examples

We put popular languages code examples under Github. Please feel free to view, and pull request if you have any updates: PractiTest Api Code Examples in Github.

Python

GET example for retrieving all projects

POST example for creating a new instance

PUT example for updating a specific instance

DELETE example for deleting a specific instance

POST example (with attachments) for Python version 2 for uploading test results to PractiTest with files

POST example (with attachments) for Python version 3 for uploading test results to PractiTest with files

Ruby

GET example for retrieving all projects

POST example for creating a new instance

PUT example for updating a specific instance

DELETE example for deleting a specific instance

POST example (with attachments) for uploading test results to PractiTest with files

Selenium example with POST request for uploading test results to PractiTest with steps

Java

GET example for retrieving all projects

POST example for creating a new instance

PUT example for updating a specific instance

DELETE example for deleting a specific instance

POST example (with attachments) for uploading test results to PractiTest with files

C sharp (.Net)

GET example for retrieving all projects will be added soon.

POST example for creating a new instance

PUT example for updating a specific instance

DELETE example for deleting a specific instance

POST example (with attachments) for uploading test results to PractiTest with files

Authentication

    curl -H "Content-Type: application/json" \
     -u YOUR_EMAIL:YOUR_TOKEN  \
    https://api.practitest.com/api/v2/projects.json
# IS THE SAME AS:
    curl -H "Content-Type: application/json" \
    https://api.practitest.com/api/v2/projects.json?developer_email=YOUR_EMAIL&api_token=YOUR_TOKEN
// https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.getresponse%28v=vs.110%29.aspx
string token = "xxx";
string developerEmail = "my@email.address";

var request = WebRequest.Create("https://api.practitest.com/api/v2/projects.json");
//request.PreAuthenticate = true;
string authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(developerEmail + ":" + token));
request.Headers["Authorization"] = "Basic " + authInfo;
// Console.WriteLine("Authorization: Basic " + authInfo);

try {
  var response = request.GetResponse();
  Console.WriteLine(response.Headers);
  // Get the stream associated with the response.
  Stream receiveStream = response.GetResponseStream ();

  // Pipes the stream to a higher level stream reader with the required encoding format.
  StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);

  Console.WriteLine ("Response stream received.");
  Console.WriteLine (readStream.ReadToEnd ());
  response.Close ();
  readStream.Close ();
} catch (WebException ex) {
  Console.WriteLine("Exception:");
  Console.WriteLine(ex.Response.Headers);
  var resp = new StreamReader(ex.Response.GetResponseStream()).ReadToEnd();
  Console.WriteLine(resp);
}
require 'net/http'
require 'net/https'
require 'uri'
require 'json'

URL   = "https://api.practitest.com"
TOKEN = "xxx"
DEVELOPER_EMAIL= "my@mail.address"

uri = URI.parse("#{URL}/api/v2/projects.json")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri.path)
req.basic_auth DEVELOPER_EMAIL, TOKEN
res = http.request(req)
puts res.body
import httplib
import requests
from requests.auth import AuthBase
res = requests.get('https://api.practitest.com/api/v2/projects.json', auth=('user@pt.com', 'dd2d9ddee2e9cd4861b1f0353375de1b4444d49'))
print res.status_code
print res.text

This command: https://api.practitest.com/api/v2/projects.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "4581",
      "type": "projects",
      "attributes": {
        "name": "Sanity check (Rails 4)",
        "created-at": "2016-07-28T13:34:51Z",
        "automation-support": false,
        "enable-delete-issues": false,
        "time-management-support": false
      }
    },
    {
      "id": "4578",
      "type": "projects",
      "attributes": {
        "name": "Sanity Check (screen captures)",
        "created-at": "2016-06-20T11:32:52Z",
        "automation-support": false,
        "enable-delete-issues": true,
        "time-management-support": false
      }
    }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects.json?api_token=afb913899fc295e809255fbdb4fbc1fb37296250&developer_email=admin%40pt.com&page%5Bnumber%5D=1&page%5Bsize%5D=2",
    "next": "https://api.practitest.com/api/v2/projects.json?api_token=afb913899fc295e809255fbdb4fbc1fb37296250&developer_email=admin%40pt.com&page%5Bnumber%5D=2&page%5Bsize%5D=2",
    "last": "https://api.practitest.com/api/v2/projects.json?api_token=afb913899fc295e809255fbdb4fbc1fb37296250&developer_email=admin%40pt.com&page%5Bnumber%5D=3&page%5Bsize%5D=2"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 3,
    "total-count": 5
  }
}

Make sure to replace YOUR_TOKEN with your API token and YOUR_EMAIL with your email address.

PractiTest uses API tokens for authentication. You can create a new API token by going to the Account Settings - “API Tokens”. Please visit API tokens for more information.

API expects the API-token and developer email to be included in all API requests to the server. They can be either in the header as basic authentication, OR as parameters in the query string (which is usually more convinient with browser’s debugging)

Pagination

Get all resources supports paginations, for example, to retrive projects:

HTTP Request

GET http://api.practitest.com/api/v2/projects.json

Pagination Parameters

Parameter Default Description
page[number] 1 the page number starting from 1
page[size] 100 number of entities displayed on a page, the maximum is 100 entities displayed per page

Projects

GET all projects

This endpoint retrieves all projects.

HTTP Request

GET https://api.practitest.com/api/v2/projects.json

Query Parameters

Parameter Default Description
page[number] 1 the page number starting from 1
page[size] 100 number of entities displayed per page

Note: The example query parameters above use unencoded [ and ] characters simply for readability. In practice, these characters must be percent-encoded as page%5Bnumber%5D and page%5Bsize%5D

Here’s the examples of the JSON requests and responses that you may get when submitting a GET request

Remember, you can see examples in the dark area to the right.

Users

GET all users at your account

This endpoint retrieves all users.

HTTP Request

https://api.practitest.com/api/v2/users.json

Query Parameters - pagination

Here’s the examples of the JSON requests and response that you may get when submitting a GET request

Remember, you can see examples in the dark area to the right.

    curl -H "Content-Type: application/json" \
     -u YOUR_EMAIL:YOUR_TOKEN  \
    https://api.practitest.com/api/v2/users.json
# IS THE SAME AS:
    curl -H "Content-Type: application/json" \
    https://api.practitest.com/api/v2/users.json?developer_email=YOUR_EMAIL&api_token=YOUR_TOKEN
string token = "xxx";
string developerEmail = "my@email.address";

var request = WebRequest.Create("https://api.practitest.com/api/v2/users.json");
//request.PreAuthenticate = true;
string authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(developerEmail + ":" + token));
request.Headers["Authorization"] = "Basic " + authInfo;

var response = request.GetResponse();
Console.WriteLine(response.Headers);

This command: https://api.practitest.com/api/v2/users.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": [
    {
      "id": "53811",
      "type": "users",
      "attributes": {
        "first-name": null,
        "last-name": null,
        "display-name": "chris.z@rd.com",
        "email": "chris.z@rd.com",
        "time-zone": "UTC",
        "created-at": "2016-05-30T16:45:02+03:00"
      }
    },
    {
      "id": "538724",
      "type": "users",
      "attributes": {
        "first-name": null,
        "last-name": null,
        "display-name": "monica@gmail.com",
        "email": "monica@gmail.com",
        "time-zone": "UTC",
        "created-at": "2016-06-20T14:35:19+03:00"
      }
    },
    {
      "id": "539467",
      "type": "users",
      "attributes": {
        "first-name": null,
        "last-name": null,
        "display-name": "pascal@most.com",
        "email": "pascal@most.com",
        "time-zone": "UTC",
        "created-at": "2016-07-07T17:44:15+03:00"
      }
    },
    {
      "id": "539598",
      "type": "users",
      "attributes": {
        "first-name": null,
        "last-name": null,
        "display-name": "phillip.rik@pt.com",
        "email": "phillip.rik@pt.com",
        "time-zone": "UTC",
        "created-at": "2016-07-27T15:08:14+03:00"
      }
    },
    {
      "id": "539976",
      "type": "users",
      "attributes": {
        "first-name": null,
        "last-name": null,
        "display-name": "beck735306@pt.com",
        "email": "beck735306@pt.com",
        "time-zone": "UTC",
        "created-at": "2016-08-08T15:05:13+03:00"
      }
    }
  ],
  "links": {},
  "meta": {
    "current-page": 1,
    "next-page": null,
    "prev-page": null,
    "total-pages": 1,
    "total-count": 5
  }
}

Custom Fields

GET all custom fields in your project

This endpoint retrieves all custom fields.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/custom_fields.json

Query Parameters - pagination

Here’s the example of the JSON request and response that you may get when submitting a GET request

Remember, you can see examples in the dark area to the right.

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/custom_fields.json

This command: https://api.practitest.com/api/v2/projects/4566/custom_fields.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "45916",
      "type": "custom-fields",
      "attributes": {
        "name": "che",
        "field-format": "multilist",
        "project-id": 4566,
        "possible-values": [
          "dog",
          "cat"
        ],
        "parent-list-id": null,
        "possible-values-parent-cf-id": 45911,
        "created-at": "2016-12-19T14:00:45+02:00",
        "updated-at": "2016-12-19T14:00:45+02:00"
      }
    },
    {
      "id": "459187",
      "type": "custom-fields",
      "attributes": {
        "name": "Multilist (Dec 19th)",
        "field-format": "multilist",
        "project-id": 4566,
        "possible-values": [
          "one",
          "two",
          "three"
        ],
        "parent-list-id": null,
        "possible-values-parent-cf-id": null,
        "created-at": "2016-12-19T12:41:51+02:00",
        "updated-at": "2016-12-19T12:41:51+02:00"
      }
    }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects/4566/custom_fields.json?api_token=a519a5d2ea4fad48e24ae929b03c753c68fb799c&developer_email=christine%40pt.com&page%5Bnumber%5D=1&page%5Bsize%5D=2",
    "next": "https://api.practitest.com/api/v2/projects/4566/custom_fields.json?api_token=a519a5d2ea4fad48e24ae929b03c753c68fb799c&developer_email=christine%40pt.com&page%5Bnumber%5D=2&page%5Bsize%5D=2",
    "last": "https://api.practitest.com/api/v2/projects/4566/custom_fields.json?api_token=a519a5d2ea4fad48e24ae929b03c753c68fb799c&developer_email=christine%40pt.com&page%5Bnumber%5D=19&page%5Bsize%5D=2"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 19,
    "total-count": 37
  }
}

GET a specific custom field in your project

This endpoint retrieves a specific custom field.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/custom_fields/YOUR_CUSTOM_FIELD_ID.json

Here’s the example of the JSON request and response that you may get when submitting a GET request

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/custom_fields/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/custom_fields/45893.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "45893",
    "type": "custom-fields",
    "attributes": {
      "name": "Test API2",
      "field-format": "list",
      "project-id": 4566,
      "possible-values": [
        "one",
        "five"
      ],
      "parent-list-id": null,
      "possible-values-parent-cf-id": null,
      "created-at": "2016-12-08T18:26:54+02:00",
      "updated-at": "2016-12-19T16:53:28+02:00"
    }
  }
}

PUT a specific custom field in your project

This endpoint updates a specific custom field.

HTTP Request

PUT https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/custom_fields/YOUR_CUSTOM_FIELD_ID.json

Query Parameters - pagination

Parameter Description
data/attributes/name the name of a custom field
data/attributes/possible-values values that can be set for a custom field
data/attributes/parent-list-id the id of a parent list that can be set for a “linked list” custom field
data/attributes/possible-values-parent-cf-id the id of an existing list where you can take values for a custom field

Here’s the example of the JSON request and response that you may get when submitting a PUT request

Remember, you can see examples in the dark area to the right.

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X PUT https://api.practitest.com/api/v2/projects/4566/custom_fields/45893.json \
-d '{"data": { "type": "custom_fields", "attributes": {"name":"Test API3", "possible-values": ["one","six"]}  } }'

The above command returns JSON structured like below:

{
  "data": {
    "id": "45893",
    "type": "custom-fields",
    "attributes": {
      "name": "Test API3",
      "field-format": "list",
      "project-id": 4566,
      "possible-values": [
        "one",
        "six"
      ],
      "parent-list-id": null,
      "possible-values-parent-cf-id": null,
      "created-at": "2016-12-08T18:26:54+02:00",
      "updated-at": "2016-12-20T14:39:24+02:00"
    }
  }
}

Requirements

GET all Requirements in your project

This endpoint retrieves all Requirements.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/requirements.json

Query Parameters - pagination

Parameters* Description
filter-id the Requirement’s filter id -> showing requirements that are in this filter
filter-user-id if filter uses current_user criteria in it, you should provide which is the this user (list of user ids)
display-ids filter Requirements with display-ids (separated by commas)
name_exact filter by Requirement name exact match; case sensitive!
name_like filter by Requirement name: case insensitive, phrase can be inside the name
# Some request examples:

# Get all requirements of project #4566:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/requirements.json

# Get all requirements of project #4566, where filter-id is 323 and name is like login
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/requirements.json?filter-id=323&name_like=login

# Get all Requirements with display ids 2,4 from project #4566
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/requirements.json?display-ids=2,4

This command: https://api.practitest.com/api/v2/projects/4566/requirements.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "1850360",
      "type": "requirements",
      "attributes": {
        "project-id": 1230,
        "display-id": 205,
        "name": "first name",
        "instances-count": 0,
        "run-status": "FAILED",
        "last-run": "2017-01-27T13:35:25+00:00",
        "assigned-to-id": null,
        "planned-execution": null,
        "version": null,
        "priority": null,
        "custom-fields": {
        "---f-8282": "High",
        },
        "folder-id": null,
        "created-at": "2017-01-27T12:19:46+00:00",
        "updated-at": "2017-01-27T12:24:07+00:00"
    }
  }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects/1282/requirements.json?api_token=YOUR_TOKEN
YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=1&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "next": "https://api.practitest.com/api/v2/projects/1282/requirements.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=2&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "last": "https://api.practitest.com/api/v2/projects/1282/requirements.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=3&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 5,
    "total-count": 13
  }
}

Create a Requirement

This endpoint creates a Requirement in your project.

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/requirements.json

Parameters Description required?
data/attributes/name name true
data/attributes/description description false
data/attributes/author-id user-id of author true
data/attributes/assigned-to-id user-id of assigned-to user (not Display ID) - users list false
data/attributes/version string of the requirement’s version false
data/attributes/priority string of the requirement’s priority false
data/attributes/custom-fields a hash of custom-fields with their value false
data/attributes/parent-id a parent’s requirement id false
data/traceability/test-ids an array of test-ids to add to the traceability of the new requirement false
data/attributes/tags an array of tags false

You can find at the right area (shell) an example of the request

# create a Requirement
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/requirements.json \
-d '{"data": { "type": "requirements", "attributes": {"name": "one", "author-id": 4370, "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# create a Requirement with 2 test-ids:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/requirements.json \
-d '{"data": { "type": "requirements", "attributes": {"name": "one", "author-id": 4370, "priority": "highest"}, "traceability": {"test-ids": [32222,53333]} }}'

Show a specific Requirement

This endpoint shows a specific Requirement in your project.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/requirements/YOUR_REQUIREMENT_ID.json

Here’s the example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/requirements/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/requirements/45893.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "1850344",
    "type": "requirements",
    "attributes": {
      "project-id": 1230,
      "display-id": 205,
      "name": "first name",
      "instances-count": 0,
      "run-status": "FAILED",
      "last-run": "2017-01-27T13:35:25+00:00",
      "assigned-to-id": null,
      "planned-execution": null,
      "version": null,
      "priority": null,
      "custom-fields": {
      "---f-8282": "High",
      },
      "folder-id": null,
      "created-at": "2017-01-27T12:19:46+00:00",
      "updated-at": "2017-01-27T12:24:07+00:00"
  }
}
}

Update a specific Requirement

This endpoint updates a specific Requirement.

HTTP Request

PUT https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/requirements/REQUIREMENT_ID.json

Parameters

Available parameters Description
data/attributes/name name
data/attributes/description description
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list
data/attributes/version string of the requirement’s version
data/attributes/priority string of the requirement’s priority
data/attributes/custom-fields a hash of custom-fields with their value
data/attributes/parent-id a parent’s requirement id
data/attributes/tags an array of tags

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X PUT https://api.practitest.com/api/v2/projects/4566/requirements/45893.json \
-d '{"data": { "type": "requirements", "attributes": {"priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# some more examples:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/requirements/98019.json \
-d '{"data": { "type": "requirements", "attributes": {"parent-id": 32213, "priority": "2-high", "version": "1.5", "custom-fields": { "---f-45510": "5381"}}  } }'

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/requirements/98019.json \
-d '{"data": { "type": "requirements", "attributes": {"version": "1.5", "custom-fields": { "---f-45390": "Chrome"}}  } }'


{
  "data": {
    "id": "45893",
    "type": "requirements",
    "attributes": {
      ...
      "priority": "highest",
      "custom-fields": {
        "---f-22":"my text one",
        "---f-24": ["ClientA", ["ClientB"]]
      },
      ...
      "created-at": "2015-11-17T09:29:22+00:00",
      "updated-at": "2015-11-17T09:29:22+00:00"
    }
  }
}

Delete a specific Requirement

This endpoint deletes a specific Requirement.

HTTP Request

DELETE https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/requirements/YOUR_REQUIREMENT_ID.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X DELETE https://api.practitest.com/api/v2/projects/4566/requirements/45893.json

Tests

GET all tests in your project

This endpoint retrieves all tests.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/tests.json

Query Parameters - pagination

Parameters* Description
filter-id the test’s filter id -> showing tests that are in this filter of the Test Library
filter-user-id if filter uses current_user criteria in it, you should provide which is the this user (list of user ids)
display-ids filter tests with display-ids (separated by commas)
name_exact filter by test name exact match; case sensitive!
name_like filter by test name: case insensitive, phrase can be inside the name
# Some request examples:

# Get all tests of project #4566:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/tests.json

# Get all tests of project #4566, where filter-id is 323 and name is like login
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/tests.json?filter-id=323&name_like=login

# Get all tests with display ids 2,4 from project #4566
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/tests.json?display-ids=2,4

This command: https://api.practitest.com/api/v2/projects/4566/tests.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "1850360",
      "type": "tests",
      "attributes": {
        "project-id": 1230,
        "display-id": 205,
        "name": "first name",
        "description": "My description",
        "steps-count": 0,
        "status": "Ready",
        "run-status": "FAILED",
        "last-run": "2017-01-27T13:35:25+00:00",
        "author-id": 3596,
        "assigned-to-id": null,
        "cloned-from-id": null,
        "planned-execution": null,
        "version": null,
        "priority": null,
        "duration-estimate": "00:00:00",
        "custom-fields": {
        "---f-8282": "High",
        },
        "folder-id": null,
        "created-at": "2017-01-27T12:19:46+00:00",
        "updated-at": "2017-01-27T12:24:07+00:00"
    }
  }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects/1282/tests.json?api_token=YOUR_TOKEN
YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=1&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "next": "https://api.practitest.com/api/v2/projects/1282/tests.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=2&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "last": "https://api.practitest.com/api/v2/projects/1282/tests.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=3&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 5,
    "total-count": 13
  }
}

Create a test

This endpoint creates a test in your project.

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/tests.json

Parameters

Parameters Description required?
data/attributes/name name true
data/attributes/author-id user-id of author - users list true
data/attributes/description Test description false
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list false
data/attributes/planned-execution date field of planned-execution false
data/attributes/status string of status (not run status) false
data/attributes/version string of test version false
data/attributes/priority string of test priority false
data/attributes/custom-fields a hash of custom-fields with their value false
data/steps/data* an array of steps override the exit code false
data/attributes/tags an array of tags false

You can find at the right area (shell) an example of the request

# create a test
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/tests.json \
-d '{"data": { "type": "tests", "attributes": {"name": "one", "author-id": 22, "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# create a test with 2 steps:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/tests.json \
-d '{"data": { "type": "tests", "attributes": {"name": "one", "author-id": 22, "priority": "highest"}, "steps": {"data": [{"name": "step one", "description": "Step 1 description", "expected-results": "result"}, {"name": "step two", "expected-results": "result2"}] }}}'

Show a specific test

This endpoint shows a specific test in your project.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/tests/YOUR_TEST_ID.json

Here’s the example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/tests/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/tests/45893.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "1850344",
    "type": "tests",
    "attributes": {
      "project-id": 1230,
      "display-id": 205,
      "name": "first name",
      "description": "My description",
      "steps-count": 0,
      "status": "Ready",
      "run-status": "FAILED",
      "last-run": "2017-01-27T13:35:25+00:00",
      "author-id": 3596,
      "assigned-to-id": null,
      "cloned-from-id": null,
      "planned-execution": null,
      "version": null,
      "priority": null,
      "duration-estimate": "00:00:00",
      "custom-fields": {
      "---f-8282": "High",
      },
      "folder-id": null,
      "created-at": "2017-01-27T12:19:46+00:00",
      "updated-at": "2017-01-27T12:24:07+00:00"
  }
}
}

Update a specific test

This endpoint updates a specific test.

HTTP Request

PUT https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/tests/TEST_ID.json

Parameters

Available parameters Description
data/attributes/name name
data/attributes/description Test description
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list
data/attributes/planned-execution date field of planned-execution
data/attributes/status string of status (not run status)
data/attributes/version string of test version
data/attributes/priority string of test priority
data/attributes/custom-fields a hash of custom-fields with their value
data/attributes/tags an array of tags

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X PUT https://api.practitest.com/api/v2/projects/4566/tests/45893.json \
-d '{"data": { "type": "tests", "attributes": {"planned-execution":"2017-03-01T12:43:31Z", "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# some more examples:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/tests/98019.json \
-d '{"data": { "type": "tests", "attributes": {"planned-execution":"2017-03-05T12:43:31Z", "priority": "2-high", "version": "1.5", "custom-fields": { "---f-45510": "5381"}}  } }'

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/tests/98019.json \
-d '{"data": { "type": "tests", "attributes": {"version": "1.5", "custom-fields": { "---f-45390": "Chrome"}}  } }'



{
  "data": {
    "id": "45893",
    "type": "tests",
    "attributes": {
      ...
      "planned-execution": "2017-03-01T12:43:31Z",
      "priority": "highest",
      "custom-fields": {
        "---f-22":"my text one",
        "---f-24": ["ClientA", ["ClientB"]]
      },
      ...
      "created-at": "2015-11-17T09:29:22+00:00",
      "updated-at": "2015-11-17T09:29:22+00:00"
    }
  }
}

Delete a specific test

This endpoint deletes a specific test.

HTTP Request

DELETE https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/tests/YOUR_TEST_ID.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X DELETE https://api.practitest.com/api/v2/projects/4566/tests/45893.json

Run statuses count

This gives statistics data of run statuses of your project’s tests

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/tests/run_statuses_count.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/tests/run_statuses_count.json
{
  "data":{
    "type":"tests",
    "run-statuses-count":{
      "PASSED":0,
      "FAILED":0,
      "NOT COMPLETED":0,
      "NO RUN":2,
      "BLOCKED":0
    }
  }
}

Steps

GET all steps in your project

This endpoint retrieves all steps.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/steps.json

Query Parameters - pagination

Parameters* Description
test-ids filter steps with test-ids (separated by commas)
name_exact filter by step name exact match; case sensitive!
name_like filter by step name: case insensitive, phrase can be inside the name
# Some request examples:

# Get all steps of project #4566:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/steps.json

# Get all steps of project #4566, where name is like login
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/steps.json?name_like=login

# Get all steps with test ids 23223,43121 from project #4566
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/steps.json?test-ids=23223,43121

This command: https://api.practitest.com/api/v2/projects/4566/steps.json?test-ids=257245api_token=xx&developer_email=admin%40pt.com", returns JSON structured like below:

{
  "data": [
    {
      "id": "1443767",
      "type": "steps",
      "attributes": {
        "project-id": 914,
        "kind": "ManualStep",
        "test-id": 257245,
        "test-to-call-id": null,
        "name": "login",
        "description": "login to the first page",
        "expected-results": "you should be able to login",
        "position": 1,
        "created-at": "2015-01-29T20:17:54+00:00",
        "updated-at": "2015-01-29T20:17:54+00:00"
      }
    },
    {
      "id": "1443768",
      "type": "steps",
      "attributes": {
        "project-id": 914,
        "kind": "ManualStep",
        "test-id": 257245,
        "test-to-call-id": null,
        "name": "dashboard page",
        "description": "goto dashboard page, see graphs",
        "expected-results": "validate all graphs are equal",
        "position": 2,
        "created-at": "2015-01-29T20:17:54+00:00",
        "updated-at": "2015-01-29T20:17:54+00:00"
      }
    },
    {
      "id": "1443769",
      "type": "steps",
      "attributes": {
        "project-id": 914,
        "kind": "CallToTest",
        "test-id": 257245,
        "test-to-call-id": 97733,
        "name": "Call To Test #2: dashboard testing",
        "description": "",
        "expected-results": "",
        "position": 3,
        "created-at": "2015-01-29T20:17:55+00:00",
        "updated-at": "2015-01-29T20:17:55+00:00"
      }
    }
  ],
  "links": {},
  "meta": {
  "current-page": 1,
  "next-page": null,
  "prev-page": null,
  "total-pages": 1,
  "total-count": 3
  }
}

Show a specific step

This endpoint shows a specific step in your project.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/steps/YOUR_STEP_ID.json

In the right area see the example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/steps/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/steps/1443768.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "1443768",
    "type": "steps",
    "attributes": {
      "project-id": 914,
      "kind": "ManualStep",
      "test-id": 257245,
      "test-to-call-id": null,
      "name": "dashboard page",
      "description": "goto dashboard page, see graphs",
      "expected-results": "validate all graphs are equal",
      "position": 2,
      "created-at": "2015-01-29T20:17:54+00:00",
      "updated-at": "2015-01-29T20:17:54+00:00"
    }
  }
}

Delete a specific step

This endpoint deletes a specific step.

HTTP Request

DELETE https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/steps/YOUR_STEP_ID.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X DELETE https://api.practitest.com/api/v2/projects/4566/steps/45893.json

TestSets

GET all TestSets in your project

This endpoint retrieves all TestSets.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets.json

Query Parameters - pagination

Parameters* Description
filter-id the TestSet’s filter id -> showing TestSets that are in this filter
filter-user-id if filter uses current_user criteria in it, you should provide which is the this user (list of user ids)
display-ids filter TestSets with display-ids (separated by commas)
name_exact filter by TestSet name exact match; case sensitive!
name_like filter by TestSet name: case insensitive, phrase can be inside the name
# Some request examples:

# Get all sets of project #4566:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/sets.json

# Get all sets of project #4566, where filter-id is 323 and name is like login
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/sets.json?filter-id=323&name_like=login

# Get all TestSets with display ids 2,4 from project #4566
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/sets.json?display-ids=2,4

This command: https://api.practitest.com/api/v2/projects/4566/sets.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "1850360",
      "type": "sets",
      "attributes": {
        "project-id": 1230,
        "display-id": 205,
        "name": "first name",
        "instances-count": 0,
        "run-status": "FAILED",
        "last-run": "2017-01-27T13:35:25+00:00",
        "assigned-to-id": null,
        "planned-execution": null,
        "version": null,
        "priority": null,
        "custom-fields": {
        "---f-8282": "High",
        },
        "folder-id": null,
        "created-at": "2017-01-27T12:19:46+00:00",
        "updated-at": "2017-01-27T12:24:07+00:00"
    }
  }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects/1282/sets.json?api_token=YOUR_TOKEN
YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=1&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "next": "https://api.practitest.com/api/v2/projects/1282/sets.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=2&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "last": "https://api.practitest.com/api/v2/projects/1282/sets.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=3&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 5,
    "total-count": 13
  }
}

Create a TestSet

This endpoint creates a TestSet in your project.

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets.json

Parameters

Parameters Description required?
data/attributes/name name true
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list false
data/attributes/planned-execution date field of planned-execution false
data/attributes/status string of status (not run status) false
data/attributes/version string of TestSet version false
data/attributes/priority string of TestSet priority false
data/attributes/custom-fields a hash of custom-fields with their value false
data/instances/test-ids an array of test-ids to add as instances to the new TestSet false
data/attributes/tags an array of tags false

You can find at the right area (shell) an example of the request

# create a Test Set
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/sets.json \
-d '{"data": { "type": "sets", "attributes": {"name": "one", "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# create a Test Set with 2 test-ids to become instances:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/sets.json \
-d '{"data": { "type": "sets", "attributes": {"name": "one", "priority": "highest"}, "instances": {"test-ids": [32222,53333]} }}'

Show a specific TestSet

This endpoint shows a specific TestSet in your project.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets/YOUR_SET_ID.json

Here’s the example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/sets/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/sets/45893.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "1850344",
    "type": "sets",
    "attributes": {
      "project-id": 1230,
      "display-id": 205,
      "name": "first name",
      "instances-count": 0,
      "run-status": "FAILED",
      "last-run": "2017-01-27T13:35:25+00:00",
      "assigned-to-id": null,
      "planned-execution": null,
      "version": null,
      "priority": null,
      "custom-fields": {
      "---f-8282": "High",
      },
      "folder-id": null,
      "created-at": "2017-01-27T12:19:46+00:00",
      "updated-at": "2017-01-27T12:24:07+00:00"
  }
}
}

Update a specific TestSet

This endpoint updates a specific TestSet.

HTTP Request

PUT https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets/SET_ID.json

Parameters

Available parameters Description
data/attributes/name name
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list
data/attributes/planned-execution date field of planned-execution
data/attributes/version string of TestSet version
data/attributes/priority string of TestSet priority
data/attributes/custom-fields a hash of custom-fields with their value
data/attributes/tags an array of tags

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X PUT https://api.practitest.com/api/v2/projects/4566/sets/45893.json \
-d '{"data": { "type": "sets", "attributes": {"planned-execution":"2017-03-01T12:43:31Z", "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# some more examples:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/sets/98019.json \
-d '{"data": { "type": "sets", "attributes": {"planned-execution":"2017-03-05T12:43:31Z", "priority": "2-high", "version": "1.5", "custom-fields": { "---f-45510": "5381"}}  } }'

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/sets/98019.json \
-d '{"data": { "type": "sets", "attributes": {"version": "1.5", "custom-fields": { "---f-45390": "Chrome"}}  } }'



{
  "data": {
    "id": "45893",
    "type": "sets",
    "attributes": {
      ...
      "planned-execution": "2017-03-01T12:43:31Z",
      "priority": "highest",
      "custom-fields": {
        "---f-22":"my text one",
        "---f-24": ["ClientA", ["ClientB"]]
      },
      ...
      "created-at": "2015-11-17T09:29:22+00:00",
      "updated-at": "2015-11-17T09:29:22+00:00"
    }
  }
}

Delete a specific TestSet

This endpoint deletes a specific TestSet.

HTTP Request

DELETE https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets/YOUR_SET_ID.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X DELETE https://api.practitest.com/api/v2/projects/4566/sets/45893.json

Clone a TestSet

This clones a single TestSet, with new empty instances. Additional parameters can be applied if you need to change attributes

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets/SET_ID/clone.json

Parameters

Available parameters Description
data/attributes/name name
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list
data/attributes/planned-execution date field of planned-execution
data/attributes/version string of TestSet version
data/attributes/priority string of TestSet priority
data/attributes/custom-fields a hash of custom-fields with their value
data/attributes/tags an array of tags

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/sets/45893/clone.json \
-d '{"data": { "type": "sets", "attributes": {"name": "my new cloned TestSet", "planned-execution":"2017-03-01T12:43:31Z", "priority": "highest", "custom-fields": { "---f-8282": "High", "---f-24": ["ClientA", "ClientB"]}}  } }'

{
  "data": {
    "id": "1850344",
    "type": "sets",
    "attributes": {
      "project-id": 1230,
      "display-id": 205,
      "name": "my new cloned testSset",
      "instances-count": 5,
      "run-status": "NO RUN",
      "last-run": null,
      "assigned-to-id": null,
      "planned-execution": "2017-03-01T12:43:31Z",
      "version": null,
      "priority": "highest",
      "custom-fields": {
      "---f-8282": "High",
      "---f-24": ["ClientA", "ClientB"]
      },
      "folder-id": null,
      "created-at": "2017-01-27T12:19:46+00:00",
      "updated-at": "2017-01-27T12:24:07+00:00"
  }
}

Instances

GET all instances in your project

This endpoint retrieves all instances.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/instances.json

Query Parameters - pagination

Parameters* Description
set-filter-id the testSet’s filter id -> showing instances of TestSets which are in this filter
set-filter-user-id if filter uses current_user criteria in it, you should provide which is the this user (list of user ids)
test-ids filter instances that are related to a certain test_id (NOT display-id!)
set-ids filter by TestSets ids, separated by comma (NOT display-id)
name_exact filter by instance name exact match; case sensitive!
name_like filter by instance name: case insensitive, phrase can be inside the name
display-id filter instances based on an instance display-id (can be used to convert display to system id)
# Some request examples:

# Get all instances of project #4566:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/instances.json

# Get all instances of project #4566, where TestSet filter-id is 323 and Instance name is like login
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/instances.json?set-filter-id=323&name_like=login

# Get all instances of project #4566, of Test-ids 1111 where they belong to TestSets 32321 or 223254
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/instances.json?test-ids=1111&set-ids=32321,223254

This command: https://api.practitest.com/api/v2/projects/4566/instances.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "1850360",
      "type": "instances",
      "attributes": {
        "name": "User login",
        "project-id": 1282,
        "set-id": 96530,
        "set-display-id": 117,
        "test-id": 369093,
        "test-display-id": 2372,
        "custom-fields": {
          "---f-2640": "my text one",
          "---f-2641": ["foo0"]
        },
        "display-id": "117:19",
        "tester-id": 4825,
        "priority": null,
        "last-run-duration": "00:00:00",
        "last-run": "2015-11-18T07:46:57+00:00",
        "run-status": "PASSED",
        "planned-execution": null,
        "version": null,
        "assigned-to-id": null,
        "created-at": "2015-11-17T09:29:22+00:00",
        "updated-at": "2015-11-17T09:29:22+00:00"
      }
    },
    {
      "id": "1850361",
      "type": "instances",
      "attributes": {
        "name": "User delete",
        "project-id": 1282,
        "set-id": 96530,
        "set-display-id": 117,
        "test-id": 369094,
        "test-display-id": 2373,
        "custom-fields": {},
        "display-id": "117:20",
        "tester-id": 4825,
        "priority": null,
        "last-run-duration": "00:00:00",
        "last-run": "2015-11-19T04:42:30+00:00",
        "run-status": "PASSED",
        "planned-execution": null,
        "version": null,
        "assigned-to-id": null,
        "created-at": "2015-11-17T09:29:22+00:00",
        "updated-at": "2015-11-17T09:29:22+00:00"
      }
    }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects/1282/instances.json?api_token=b28a2be5e18491c7779e224ac60c4f815407d923&developer_email=dkd%40dkd.com&name_like=Issuer3&page%5Bnumber%5D=1&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "next": "https://api.practitest.com/api/v2/projects/1282/instances.json?api_token=b28a2be5e18491c7779e224ac60c4f815407d923&developer_email=dkd%40dkd.com&name_like=Issuer3&page%5Bnumber%5D=2&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "last": "https://api.practitest.com/api/v2/projects/1282/instances.json?api_token=b28a2be5e18491c7779e224ac60c4f815407d923&developer_email=dkd%40dkd.com&name_like=Issuer3&page%5Bnumber%5D=3&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 5,
    "total-count": 13
  }
}

Create an instance

This endpoint creates an instance in your project.

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/instances.json

Parameters

Parameters Description required?
data/attributes/set-id TestSet id (not display id) true
data/attributes/test-id Test id (not display id) true
data/attributes/planned-execution date field of planned-execution false
data/attributes/version string of instance version false
data/attributes/priority string of instance priority false
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list false
data/attributes/custom-fields a hash of custom-fields with their value false

You can find at the right area (shell) an example of the request

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/instances.json \
-d '{"data": { "type": "instances", "attributes": {"test-id": 233, "set-id": 33, "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

Show a specific instance

This endpoint shows a specific instance in your project.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/instances/YOUR_INSTANCE_ID.json

Here’s the example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/instances/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/instances/45893.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "1850344",
    "type": "instances",
    "attributes": {
      "name": "SmokeTest_ECR_Purchase&ReversalIssuer30",
      "project-id": 1282,
      "set-id": 96530,
      "set-display-id": 117,
      "test-id": 369077,
      "test-display-id": 2356,
      "custom-fields": {},
      "display-id": "117:3",
      "tester-id": 4825,
      "priority": null,
      "last-run-duration": "00:00:00",
      "last-run": "2015-11-18T04:57:21+00:00",
      "run-status": "PASSED",
      "planned-execution": null,
      "version": null,
      "assigned-to-id": null,
      "created-at": "2015-11-17T09:29:22+00:00",
      "updated-at": "2015-11-17T09:29:22+00:00"
    }
  }
}

Update a specific instance

This endpoint updates a specific instance.

HTTP Request

PUT https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/instances/YOUR_INSTANCE_ID.json

Parameters

Available parameters Description
data/attributes/planned-execution date field of planned-execution
data/attributes/version string of instance version
data/attributes/priority string of instance priority
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list
data/attributes/custom-fields a hash of custom-fields with their value

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X PUT https://api.practitest.com/api/v2/projects/4566/instances/45893.json \
-d '{"data": { "type": "instances", "attributes": {"planned-execution":"2017-03-01T12:43:31Z", "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# some more examples:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/instances/98019.json \
-d '{"data": { "type": "instances", "attributes": {"planned-execution":"2017-03-05T12:43:31Z", "priority": "2-high", "version": "1.5", "custom-fields": { "---f-45510": "5381"}}  } }'

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/instances/98019.json \
-d '{"data": { "type": "instances", "attributes": {"version": "1.5", "custom-fields": { "---f-45390": "Chrome"}}  } }'



{
  "data": {
    "id": "45893",
    "type": "instances",
    "attributes": {
      ...
      "planned-execution": "2017-03-01T12:43:31Z",
      "priority": "highest",
      "custom-fields": {
        "---f-22":"my text one",
        "---f-24": ["ClientA", ["ClientB"]]
      },
      ...
      "created-at": "2015-11-17T09:29:22+00:00",
      "updated-at": "2015-11-17T09:29:22+00:00"
    }
  }
}

Delete a specific instance

This endpoint deletes a specific instance.

HTTP Request

DELETE https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/instances/YOUR_INSTANCE_ID.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X DELETE https://api.practitest.com/api/v2/projects/4566/instances/45893.json

Runs

GET all runs in your project

This endpoint retrieves all runs.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/runs.json

Query Parameters - pagination

Parameters* Description
test-ids filters runs that are related to a certain test_id/ids, separated by comma (NOT display-id!)
set-ids filter by TestSets ids, separated by comma (NOT display-id)
instance-ids filter by Instances ids, separated by comma (NOT display-id)
run-type: ‘AutomatedRun ManualRun’
set-filter-id the testSet’s filter id -> showing runs of TestSets which are in this filter
set-filter-user-id if filter uses current_user criteria in it, you should provide which is the this user (list of user ids)
updated-hours-ago showing runs that were updated # hours ago
# Some request examples:

# Get all runs of project #4566:

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/runs.json

# Get all runs of project #4566, of Test-ids 80895

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/runs.json?test-ids=80895

This command: https://api.practitest.com/api/v2/projects/4566/runs.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{  
   "data":[  
      {  
         "id":"49676",
         "type":"runs",
         "attributes":{  
            "project-id":4566,
            "status":"NO RUN",
            "tester-id":5380,
            "instance-id":98016,
            "test-id":80893,
            "run-type":"ManualRun",
            "custom-fields":{  

            },
            "automated-execution-output":null,
            "run-duration":"00:53:20",
            "created-at":"2017-03-07T11:10:42+02:00",
            "updated-at":"2017-03-07T12:04:44+02:00"
         }
      },
      {  
         "id":"49663",
         "type":"runs",
         "attributes":{  
            "project-id":4566,
            "status":"NOT COMPLETED",
            "tester-id":5380,
            "instance-id":98016,
            "test-id":80893,
            "run-type":"ManualRun",
            "custom-fields":{  

            },
            "automated-execution-output":null,
            "run-duration":"00:00:00",
            "created-at":"2017-02-21T13:25:34+02:00",
            "updated-at":"2017-02-21T13:25:34+02:00"
         }
      }
   ],
   "links":{  
      "self":"https://api.practitest.com/api/v2/projects/4566/runs.json?api_token=xx&developer_email=pt%40gmail.com&page%5Bnumber%5D=1&page%5Bsize%5D=2",
      "next":"https://api.practitest.com/api/v2/projects/4566/runs.json?api_token=xx&developer_email=pt%40gmail.com&page%5Bnumber%5D=2&page%5Bsize%5D=2",
      "last":"https://api.practitest.com/api/v2/projects/4566/runs.json?api_token=xx&developer_email=pt%40gmail.com&page%5Bnumber%5D=41&page%5Bsize%5D=2"
   },
   "meta":{  
      "current-page":1,
      "next-page":2,
      "prev-page":null,
      "total-pages":41,
      "total-count":81
   }
}

Create a run (Automated Test)

This endpoint upload new run results to your project.

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/runs.json

Parameters

Parameters Description required?
data/attributes/instance-id* Instance id (not display-id) true
data/attributes/exit-code 0 for passed, otherwise failed false
data/attributes/run-duration (HH:MM:SS), to update the run duration of a specific instance false
data/attributes/automated-execution-output text output string that will be shown in ‘Execution output’ field (up to 255 characters) false
data/attributes/custom-fields a hash of custom-fields with their value false
data/steps/data** an array of steps override the exit code false
data/files/data*** an array of files false

** Steps array includes steps json hash, with these attributes: name, description, expected-results, actual-results, status. Status can be one of the following: PASSED, FAILED, BLOCKED, NO RUN, N/A When using steps, the exit-code is ignored, and it calculates it according to the steps status.

*** files would be as an attachments in your automated tests. It’s a json hash that has two attributes: filename, and content_encoded. We expect to get the file content encoded as BASE64. See code examples: shell with curl to your right, Ruby example here, Python version 2 example here, Python version 3 example here, Java example here, C sharp (.Net) example here.

# upload test results with a file attachment
curl -H "Content-Type:application/json" \
   -u test@pt.com:YOUR TOKEN \
   -X POST https://api.practitest.com/api/v2/projects/1/runs.json \
   -d '{"data": { "type": "instances", "attributes": {"instance-id": 3254471, "exit-code": 0 }, "files": {"data": [{"filename": "one.log", "content_encoded": "'"$( base64 /tmp/one.log)"'" }, {"filename": "two.log", "content_encoded": "'"$( base64 /tmp/two.log)"'" }]} }  }'

# upload test results with the automated-execution-output
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/runs.json \
-d '{"data": { "type": "instances", "attributes": {"instance-id": 98142, "exit-code": 0, "automated-execution-output": "THIS IS MY OUTPUT" }}} '

# example with steps
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/runs.json \
-d '{"data": {"type": "instances", "attributes": {"instance-id": 98142}, "steps": {"data": [{"name": "step one", "expected-results": "result", "status": "FAILED"}, {"name": "step two", "expected-results": "result2", "status": "PASSED"}] }}}'

# example with custom-fields
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X POST https://api.practitest.com/api/v2/projects/4566/runs.json \
-d '{"data": { "type": "instances", "attributes": {"instance-id": 98142, "exit-code": 0, "custom-fields": { "---f-45293": "Win" }}}} '

# example with updating multiple instances with results
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/runs.json \
-d '{"data": [{ "type": "instances", "attributes": {"instance-id": 105716, "exit-code": 0, "automated-execution-output": "THIS IS MY OUTPUT"}}, { "type": "instances", "attributes": {"instance-id": 105717, "exit-code": 0, "automated-execution-output": "THIS IS MY OUTPUT"}}]}'

Issues

GET all Issues in your project

This endpoint retrieves all Issues.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/issues.json

Query Parameters - pagination

Parameters* Description
filter-id the Issues filter id -> showing Issues that are in this filter
filter-user-id if filter uses current_user criteria in it, you should provide which is the this user (list of user ids)
display-ids filter Issues with display-ids (separated by commas)
title_exact filter by Issue name exact match; case sensitive!
title_like filter by Issue name: case insensitive, phrase can be inside the name
# Some request examples:

# Get all issues of project #4566:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/issues.json

# Get all issues of project #4566, where filter-id is 323 and title is like login
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/issues.json?filter-id=323&title_like=login

# Get all issues with display ids 2,4 from project #4566
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/issues.json?display-ids=2,4

This command: https://api.practitest.com/api/v2/projects/4566/issues.json?api_token=xx&developer_email=admin%40pt.com&page[number]=1&page[size]=2", returns JSON structured like below:

{
  "data": [
    {
      "id": "1850360",
      "type": "issues",
      "attributes": {
        "project-id": 1230,
        "display-id": 205,
        "title": "first name",
        "instances-count": 0,
        "run-status": "FAILED",
        "last-run": "2017-01-27T13:35:25+00:00",
        "assigned-to-id": null,
        "planned-execution": null,
        "version": null,
        "priority": null,
        "custom-fields": {
        "---f-8282": "High",
        },
        "folder-id": null,
        "created-at": "2017-01-27T12:19:46+00:00",
        "updated-at": "2017-01-27T12:24:07+00:00"
    }
  }
  ],
  "links": {
    "self": "https://api.practitest.com/api/v2/projects/1282/issues.json?api_token=YOUR_TOKEN
YOUR_TOKEN&developer_email=your_EMAIL&name_like=Issuer3&page%5Bnumber%5D=1&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "next": "https://api.practitest.com/api/v2/projects/1282/issues.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&title_like=Issuer3&page%5Bnumber%5D=2&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530",
    "last": "https://api.practitest.com/api/v2/projects/1282/issues.json?api_token=YOUR_TOKEN&developer_email=your_EMAIL&title_like=Issuer3&page%5Bnumber%5D=3&page%5Bsize%5D=6&set_filter_id=70859&set_ids=96530"
  },
  "meta": {
    "current-page": 1,
    "next-page": 2,
    "prev-page": null,
    "total-pages": 5,
    "total-count": 13
  }
}

Create an Issue

This endpoint creates an Issue in your project.

HTTP Request

POST https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/issues.json

Parameters Description required?
data/attributes/title name true
data/attributes/description description false
data/attributes/author-id user-id of author true
data/attributes/assigned-to-id user id of assigned-to user (not Display ID) - users list false
data/attributes/version string of the issue’s version false
data/attributes/priority string of the issue’s priority false
data/attributes/custom-fields a hash of custom-fields with their value false
data/attributes/issue-type issue type false
data/attributes/tags an array of tags false

You can find at the right area (shell) an example of the request

# create an issue
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/issues.json \
-d '{"data": { "type": "issues", "attributes": {"title": "one", "author-id": 4370, "priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# create an issue with description and issue type:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X POST https://api.practitest.com/api/v2/projects/4566/issues.json \
-d '{"data": { "type": "issues", "attributes": {"title": "TEST Issue", "description": "description", "author-id": 5863, "priority": "2-high", "issue-type": "task"}  } }'

Show a specific Issue

This endpoint shows a specific Issue in your project.

HTTP Request

GET https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/issues/YOUR_ISSUE_ID.json

Here’s the example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
https://api.practitest.com/api/v2/projects/4566/issues/45893.json

This command: https://api.practitest.com/api/v2/projects/4566/issues/45893.json?api_token=YOUR_TOKEN&developer_email=YOUR_EMAIL, returns JSON structured like below:

{
  "data": {
    "id": "1850344",
    "type": "issues",
    "attributes": {
      "project-id": 1230,
      "display-id": 205,
      "title": "first name",
      "instances-count": 0,
      "run-status": "FAILED",
      "last-run": "2017-01-27T13:35:25+00:00",
      "assigned-to-id": null,
      "planned-execution": null,
      "version": null,
      "priority": null,
      "custom-fields": {
      "---f-8282": "High",
      },
      "folder-id": null,
      "created-at": "2017-01-27T12:19:46+00:00",
      "updated-at": "2017-01-27T12:24:07+00:00"
  }
}
}

Update a specific Issue

This endpoint updates a specific Issue.

HTTP Request

PUT https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/issues/ISSUE_ID.json

Parameters

Available parameters Description
data/attributes/title name
data/attributes/description description
data/attributes/assigned-to-id user assigned-to id (not Display ID) - users list
data/attributes/version string of the issue’s version
data/attributes/priority string of the issue’s priority
data/attributes/custom-fields a hash of custom-fields with their value
data/attributes/issue-type issue type
data/attributes/tags an array of tags

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X PUT https://api.practitest.com/api/v2/projects/4566/issues/45893.json \
-d '{"data": { "type": "issues", "attributes": {"priority": "highest", "custom-fields": { "---f-22": "Windows", "---f-24": ["ClientA", "ClientB"]}}  } }'

# some more examples:
curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN  \
-X PUT https://api.practitest.com/api/v2/projects/4566/issues/98019.json \
-d '{"data": { "type": "issues", "attributes": {"priority": "2-high", "version": "1.5", "issue-type": "task" }  } }'


{
  "data": {
    "id": "45893",
    "type": "issues",
    "attributes": {
      ...
      "priority": "highest",
      "custom-fields": {
        "---f-22":"my text one",
        "---f-24": ["ClientA", ["ClientB"]]
      },
      ...
      "created-at": "2015-11-17T09:29:22+00:00",
      "updated-at": "2015-11-17T09:29:22+00:00"
    }
  }
}

Delete a specific Issue

This endpoint deletes a specific Issue.

HTTP Request

DELETE https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/issues/YOUR_ISSUE_ID.json

You can find at the right area an example of the JSON request and response

curl -H "Content-Type:application/json" \
-u YOUR_EMAIL:YOUR_TOKEN \
-X DELETE https://api.practitest.com/api/v2/projects/4566/issues/45893.json

Errors

The API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The resource requested is hidden for administrators only
404 Not Found – The specified resource could not be found - please check your project_id
405 Method Not Allowed – You tried to access a resource with an invalid method
406 Not Acceptable – You requested a format that isn’t json
422 Unprocessable Entity - Your parameter values are wrong or missing.
429 Too Many Requests – You’re requesting too many resources! Slow down!
500 Internal Server Error – General server error - there was a problem with the request.
503 Service Unavailable – We’re temporarially offline for maintenance. Please try again later.