REST API Reference

Overview

API Key

In order to use the REST API, you need your project's API key which is available from the Project Dashboard:

To access the API, each request must have a custom header named x-api-key, along with the value of the API key. An example custom header is as follows:

x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4

 

Project ID

You will need your Project ID which is available from the Project dropdown menu:

Test Group ID

You may also need your Test Group ID which is available from the Test Group's Project Dashboard:

Base URL

All endpoints below should be prefixed with: https://screener.io

 


Available Actions

  1. Run Test Group
  2. Get All Projects
  3. Get All Test Groups For A Project
  4. Get All Test Reports For A Test Group
  5. Get Pages Object For A Test Group
  6. Get Script For A Page
  7. Get All States For A Test
  8. Get Recent Test Run History
  9.  


1. Run Test Group

Runs all tests in a Test Group. If there is no available test concurrency, then the test(s) will be queued.

Useful for automatically running Screener tests on a schedule, such as part of a Cron job. Email notifications will be sent to subscribers when changes are found.

Note 1: This API endpoint is for running Screener tests only (i.e. tests created using Screener Pages or Recorder). To run WebDriver tests, please refer to our WebDriver docs.
Note 2: This API endpoint only kicks off a test run; it does not wait for tests to finish, nor does it report results. To pass/fail builds based on Screener results, please refer to our Continuous Integration docs.

Endpoint

POST /api/projects/{Project ID}/groups/{Group ID}/queue
ParameterDescription
Project IDProject the test belongs to
Group IDValid Test Group ID for the tests you want to run

Response

{ success: true }

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' --data '' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups/52538627afa3e1f10c001112/queue

 


2. Get All Projects


Endpoint

GET /api/projects

Response

{
  "list": [{
    "_id": "524481fddbcf9eb1cd0002123",
    "title": "Project Name"
  }]
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects

 


3. Get All Test Groups For A Project


Endpoint

GET /api/projects/{Project ID}/groups
ParameterDescription
Project IDProject the Test Groups belongs to

Response

{
  "list": [{
    "_id": "52538627afa3e1f10c001112",
    "name": "Screener Smoketest",
    "baseUrl": "http://smoketest.screener.io"
  }]
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups

 


4. Get All Test Reports For A Test Group

Get reporting stats on all tests for a specific Test Group. The report includes individual test totals.


Endpoint

GET /api/projects/{Project ID}/groups/{Group ID}/report
ParameterDescription
Project IDProject the Test Group belongs to
Group IDValid Test Group ID

Response

{
 "list": [
   {
     "_id": "54080d74872f997b04000025",
     "browserName": "chrome",
     "environment": "",
     "group": "54080cd3872f997b0400001d",
     "groupName": "Test Group Name",
     "id": "Chrome",
     "name": "Chrome",
     "project": "53ff7334fd1f9f245a000004",
     "resolution": "1600x900",
     "updatedAt": "2014-09-10T07:20:45.416Z",
     "version": "",
     "totals": {
       "new": 6,
       "changed": 3,
       "accepted": 7,
       "rejected": 0,
       "all": 16
     }
   }
 ]
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups/52538627afa3e1f10c001112/report

 


5. Get Pages Object For A Test Group


Endpoint

GET /api/projects/{Project ID}/groups/{Group ID}/pages
ParameterDescription
Project IDProject the Test Group belongs to
Group IDValid Test Group ID

Response

Note: The "content" property returned will need to be parsed as JSON.
{
 "content": "{\"pages\":[{\"path\":\"/home\"}]}"
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups/52538627afa3e1f10c001112/pages

 


6. Get Script For A Page


Endpoint

GET /api/projects/{Project ID}/groups/{Group ID}/scripts/{Page Path}
ParameterDescription
Project IDProject the Test Group belongs to
Group IDValid Test Group ID
Page PathUrl-Encoded Page Path. E.g. for "/" the url-encoded path would be "%2F"

Response

Note: The "content" property returned will need to be parsed as JSON.
{
 "content": "{\n  \"type\": \"script\",\n  \"seleniumVersion\": 2,\n  \"formatVersion\": 1,\n  \"steps\": []\n}"
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups/52538627afa3e1f10c001112/scripts/%2Fhome

 


7. Get All States For A Test


Endpoint

GET /api/projects/{Project ID}/groups/{Group ID}/tests/{Test ID}/states
ParameterDescription
Project IDProject the Test Group belongs to
Group IDValid Test Group ID
Test IDValid Test ID in Test Group

Response

Note: The "screenshotUrl" for each state is a temporary url which is available for only 15 minutes from the time of the API request.
{
 "states": [{
   "id": "i9jhfasd-5h5ago-0",
   "name": "State Name",
   "status": "accepted",
   "screenshotUrl": "https://screener.io/..."
  }]
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups/52538627afa3e1f10c001112/tests/54080d74872f997b04000025/states

 


8. Get Recent Test Run History


Endpoint

GET /api/projects/{Project ID}/groups/{Group ID}/tests/history
ParameterDescription
Project IDProject the Test Group belongs to
Group IDValid Test Group ID
Status(Optional) Filter by Test Run status. Optional query string parameter. Example: &status=complete
Build(Optional) Filter by Build ID. Optional query string parameter. Example: &build=build-1234

Response

Note: The Test Run is no longer running when it has one of the following statuses: complete, error, timeout, cancelled.
{
"list": [
  {
    "_id": "550b6cc53c7f089004000019",
    "name": "Test 1",
    "project": "524481fddbcf9eb1cd0002123",
    "group": "52538627afa3e1f10c001112",
    "build": "build-1234",
    "resolution": "1280x1024",
    "browserName": "firefox",
    "environment": "",
    "status": "complete",
    "start": "2015-03-20T00:43:26.229Z",
    "end": "2015-03-20T00:47:53.241Z"
  }]
}

Curl Example

curl --header 'x-api-key: f092961a-63b7-42c7-8687-b999c9a903b4' https://screener.io/api/projects/524481fddbcf9eb1cd0002123/groups/52538627afa3e1f10c001112/tests/history