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
- Run Test Group
- Get All Projects
- Get All Test Groups For A Project
- Get All Test Reports For A Test Group
- Get Pages Object For A Test Group
- Get Script For A Page
- Get All States For A Test
- Get Recent Test Run History
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.
Endpoint
POST /api/projects/{Project ID}/groups/{Group ID}/queue
Parameter | Description |
---|---|
Project ID | Project the test belongs to |
Group ID | Valid 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
Parameter | Description |
---|---|
Project ID | Project 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
Parameter | Description |
---|---|
Project ID | Project the Test Group belongs to |
Group ID | Valid 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
Parameter | Description |
---|---|
Project ID | Project the Test Group belongs to |
Group ID | Valid Test Group ID |
Response
{ "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}
Parameter | Description |
---|---|
Project ID | Project the Test Group belongs to |
Group ID | Valid Test Group ID |
Page Path | Url-Encoded Page Path. E.g. for "/" the url-encoded path would be "%2F" |
Response
{ "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
Parameter | Description |
---|---|
Project ID | Project the Test Group belongs to |
Group ID | Valid Test Group ID |
Test ID | Valid Test ID in Test Group |
Response
{ "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
Parameter | Description |
---|---|
Project ID | Project the Test Group belongs to |
Group ID | Valid 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
{ "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