HomeAPIPrinter Friendly Version

API

Simple HTTP API manual with examples:

1. Basics

1.1. Prerequisites

An API key is required to make API calls. The key is automatically created when a user is added, to obtain it, login to your Test Collab account and go to 'Profile' page.

Required Knowledge

  • JSON
  • Any programming language
  • HTTP Requests

1.2. Request Parameters

A request can be of a simple 'GET' or 'POST' type depending upon the action. 'API_KEY' should always be appended as 'GET' variable for authentication.

Sample URL:

http://your-testcollab-url.com/index.php/projects/index.json?API_KEY=yourapikey

Parameters Breakdown:

Element Value Description
Base URL http://your-testcollab-url.com/index.php This is the base URL of your Test Collab setup which obviously will be consistent with all API requests.
Action URL

/projects/index

Action URL changes depending on desired entity and action you wish to perform

Extension .json Tells system to return JSON response.
API Key ?API_KEY=yourapikey API Key; As provided in your Test Collab account. This can change as per user who is performing the action.
 POST data (optional)   Some actions like adding a project or test case requires raw JSON POST.

Sample POST data:

POST should be raw JSON encoded strings and always enclosed with 'data' element.

{"data": {"Project": {"name": "My New Project"}}}

  • 'Project' here suggests the name of entity.
  • 'name' is the field name for 'Project' entity
  • 'My New Project' is the value provided for the field.

Every action requires different set of parameters. Such parameters & examples for each actions are covered in further chapters.

A note about pagination

If you are calling the index action for an entity then you can opt to have paginated results, for this the request should have following  template 

https://your-testcollab-url.com/index.php/project/{project_id}/test_cases/index/{test_suite_id}/page:1/limit:30.json

 

1.3. Response Parameters

Everytime a request is made to API, it will reply with a JSON-formatted string like this:

{
    "appState": "/project/7",
    "data": {
        "created_id": "7"
    },
    "message": "Project added.",
    "status": true
}

Parameter

Parameter Possible Values Description
status true / false Status of the requested action. 'true' means action was completed successfully. 'false' means failure of request for any reason.
message null / string The success or error message.
data.created_id  null / integer This returns the ID of newly created item as a request of API request. 'created_id' will be returned as null on all other actions except 'add' actions.
data.errors absent / JSON object If 'status' is returned false, this will usually show the reason why request was failed. It may also contain validation errors.
data.* absent / JSON object Depending upon the requested action, this will contain one or more action-specific parameters.
appState absent / string This tells you where the system redirects the end-user after the requested action is finished. This can be used to build custom UI clients with API.

2. Projects

2.1. List

URL: /projects

Example Request:

curl http://your-testcollab-url.com/index.php/projects.json?API_KEY=yourapikey

Example Response:

{
    "data": {
       "paging":{"page":1,"count":5,"limit":"10","pageCount":1},
       "projects": [
            {
                "Project": {
                    "created": "2011-04-14 18:11:27",
                    "generalMetrics": {
                        "avgExecutionTime": 430,
                        "avgExecutionTimeLabel": "7 minutes 10 seconds",
                        "defectsCount": 0,
                        "executionCasesCount": 21,
                        "executionCount": 4,
                        "passPercentage": 33.93,
                        "passedCasesCount": 13,
                        "testCasesCount": 7,
                        "totalTestSuites": 3,
                        "totalTimeSpent": 3022,
                        "totalTimeSpentLabel": "50 minutes 22 seconds"
                    },
                    "id": "1",
                    "is_archived": "0",
                    "issue_manager_project_id": "",
                    "lastActivity": {
                        "ActivityLog": {
                            "created": "2012-07-11 14:53:11",
                            "entity": "ExecutionCaseLog",
                            "entity_id": "59",
                            "id": "144",
                            "params": [],
                            "project_id": "1",
                            "type": "executionCaseAction",
                            "user_id": "1"
                        }
                    },
                    "name": "Sample 1",
                    "status": "0",
                    "user_id": "1"
                }
            },
            {
                "Project": {
                    "created": "2011-04-14 19:05:09",
                    "generalMetrics": {
                        "avgExecutionTime": 1057,
                        "avgExecutionTimeLabel": "17 minutes 37 seconds",
                        "defectsCount": 0,
                        "executionCasesCount": 24,
                        "executionCount": 4,
                        "passPercentage": 69.05,
                        "passedCasesCount": 16,
                        "testCasesCount": 10,
                        "totalTestSuites": 3,
                        "totalTimeSpent": 3171,
                        "totalTimeSpentLabel": "52 minutes 51 seconds"
                    },
                    "id": "2",
                    "is_archived": "0",
                    "issue_manager_project_id": "",
                    "lastActivity": {
                        "ActivityLog": {
                            "created": "2011-04-15 11:39:57",
                            "entity": "Execution",
                            "entity_id": "6",
                            "id": "80",
                            "params": [],
                            "project_id": "2",
                            "type": "finishedExecution",
                            "user_id": "2"
                        }
                    },
                    "name": "Sample",
                    "status": "0",
                    "user_id": "1"
                }
            }
        ]
    }
}

2.2. Add

URL: /projects/add

Acceptable POST Parameters:

Name
Is Required?
 Description
Project.name Yes  Name of the project

Example Request:

curl --data '{"data": {"Project": {"name": "New Project Name"}}}' http://your-testcollab-url.com/index.php/projects/add/1.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/7",
    "data": {
        "created_id": "7"
    },
    "message": "Project saved. You can now <a href=\"/index.php/project/7/suites/add\">add a test suite</a> or <a href=\"/index.php/project/7/project_members/multiAdd\">select team members</a> of this project.",
    "status": true
}

2.3. Update

URL: /projects/edit/{project_id}

Acceptable POST Parameters:

Name
Is Required?
 Description
Project.name Yes  Name of the project

Example Request:

curl --data '{"data": {"Project": {"name": "New Project Name"}}}' http://your-testcollab-url.com/index.php/projects/edit/1.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/projects",
    "data": {
        "created_id": null
    },
    "message": "The Project has been saved.",
    "status": true
}

2.4. Delete

URL: /projects/delete/{project_id}

Example Request:

curl http://your-testcollab-url.com/index.php/projects/delete/3.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/projects",
    "data": {
        "created_id": null
    },
    "message": "Project deleted",
    "status": true
}

3. Test Suites

3.1. Add

URL: /project/{project_id}/suites/add

Acceptable POST Parameters:

Name
Is Required?
 Description
Suite.title Yes  Title of the test suite

Example Request:

curl --data '{"data": {"Suite": {"title": "Suite","parent_id" : 1}}}' http://your-testcollab-url.com/index.php/project/1/suites/add.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/test_cases/add/24",
    "data": {
        "created_id": "24"
    },
    "message": "Test Suite saved. You can <a href=\"/project/1/test_cases/add/24\">add new test cases</a> now.",
    "status": true
}

3.2. Update

URL: /project/{project_id}/suites/edit/{suite_id}

Acceptable POST Parameters:

Name
Is Required?
 Description
Suite.title Yes  Title of the test suite

Example Request:

curl --data '{"data": {"Suite": {"title": "New Title"}}}' http://your-testcollab-url.com/index.php/project/1/suites/edit/2.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/suites/dashboard",
    "data": {
        "created_id": null
    },
    "message": "The Test Suite has been saved.",
    "status": true
}

3.3. Delete

URL: /project/{project_id}/suites/delete/{suite_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/suites/delete/22.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/suites/dashboard",
    "data": {
        "created_id": null
    },
    "message": "Test Suite deleted",
    "status": true
}

4. Test Cases

4.1. Add

URL: /project/{project_id}/test_cases/add

Acceptable POST Parameters:

Name
Is Required?
 Description
TestCase.suite_id Yes Suite ID of the test suite which this test case belongs to.
TestCase.title Yes Title of the test case
TestCase.description No Test case description
TestCase.steps No Steps of the test case delemited with blank lines. Markdown syntax can be used.
TestCase.expected_result Yes Expected result of the test case
TestCase.priority Yes Test case's priority; 0 = low, 1 = normal, 2 = high
Tag.tag No Comma-delimited tag ids for this test case

Example Request:

curl --data '{"data": {"TestCase": {"suite_id": "1", "title": "Some test case", "description":"Description goes here...", "steps":"Step 1\n\nStep 2\n\nStep 3", "expected_result": "Expected result text...", "priority": 1}, "Tag": {"tag": "3,4"}}}' http://your-testcollab-url.com/index.php/project/1/test_cases/add.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/suites/dashboard",
    "data": {
        "created_id": "42"
    },
    "message": "The Test Case has been saved!",
    "status": true
}

4.2. List

URL: /project/{project_id}/test_cases/index/{test_suite_id}.json

Example Request:

curl http://your-testcollab-url.com/index.php/project/16/test_cases/index/67.json?API_KEY=yourapikey

Example Response:

{
    "data": {
        "testCases": [
            {
                "TestCase": {
                    "id": "429",
                    "title": "Test case 1",
                    "created": "2013-12-13 12:47:13",
                    "user_id": "1",
                    "suite_id": "67",
                    "sort_order": "0",
                    "test_case_skip_condition_count": "0",
                    "description": "",
                    "steps": "",
                    "expected_result": "",
                    "priority": "1",
                    "avg_execution_time": "16",
                    "deleted": "0",
                    "use_mutli_steps": "1",
                    "raw_steps": "a:0:{}",
                    "source_project_id": "16",
                    "priorityLabel": "Normal",
                    "url": "/project/16/test_cases/view/429",
                    "tags": []
                },
                "Suite": {
                    "id": "67",
                    "title": "s11",
                    "status": "0",
                    "created": "2013-12-13 12:47:04",
                    "user_id": "1",
                    "suite_skip_condition_count": "0",
                    "deleted": "0",
                    "parent_id": "65",
                    "lft": "120",
                    "rght": "123",
                    "description": "",
                    "suite_count": "1",
                    "test_case_count": "2",
                    "source_project_id": "16"
                },
                "Attachment": [],
                "TestCaseSkipCondition": [],
                "TestCaseStep": []
            }
        ],
        "paging": {
            "page": 1,
            "count": 1,
            "limit": 10,
            "pageCount": 1
        }
    }
}

4.3. Update

URL: /project/{project_id}/test_cases/edit/{test_case_id}

Acceptable POST Parameters:

Name
Is Required?
 Description
TestCase.suite_id Yes Suite ID of the test suite which this test case belongs to.
TestCase.title Yes Title of the test case
TestCase.description No Test case description
TestCase.steps No Steps of the test case delemited with blank lines. Markdown syntax can be used.
TestCase.expected_result Yes Expected result of the test case
TestCase.priority Yes Test case's priority; 0 = low, 1 = normal, 2 = high
Tag.tag No Comma-delimited tag ids for this test case

Example Request:

curl --data '{"data": {"TestCase": {"suite_id": "1", "title": "Some test case", "description":"Description goes here...", "steps":"Step 1\n\nStep 2\n\nStep 3", "expected_result": "Expected result text...", "priority": 1}, "Tag": {"tag": "3,4"}}}' http://your-testcollab-url.com/index.php/project/1/test_cases/edit/3.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/suites/dashboard",
    "data": {
        "created_id": null
    },
    "message": "Test Case has been saved!",
    "status": true
}

4.4. Delete

URL: /project/{project_id}/test_cases/delete/{test_case_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/test_cases/delete/42.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/suites/dashboard",
    "data": {
        "created_id": null
    },
    "message": "Test Case deleted",
    "status": true
}

4.5. View

URL: /project/{project_id}/test_cases/view/{test_case_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/test_cases/view/1.json?API_KEY=yourapikey

Example Response:

{
"data": {
"testCase": {
"TestCase": {
"id": "1",
"title": "T1",
"created": "2015-01-22 00:27:54",
"user_id": "1",
"suite_id": "1",
"sort_order": "0",
"test_case_skip_condition_count": "0",
"description": "",
"steps": "",
"expected_result": "",
"priority": "1",
"avg_execution_time": "13",
"deleted": "0",
"use_mutli_steps": "0",
"raw_steps": "",
"source_project_id": "1",
"priorityLabel": "Normal",
"url": "/project/1/test_cases/view/1",
"tags": [],
"avg_execution_time_display": "00 hrs 00 mins 13 sec",
"requirements": [
"7257"
]
},
"Suite": {
"id": "1",
"title": "S1",
"description": "",
"status": "0",
"created": "2015-01-22 00:27:48",
"user_id": "1",
"suite_skip_condition_count": "0",
"deleted": "0",
"parent_id": null,
"lft": "1",
"rght": "4",
"suite_count": "1",
"test_case_count": "2",
"source_project_id": "1"
},
"Attachment": [],
"TestCaseSkipCondition": [],
"TestCaseStep": []
}
}
}

5. Milestones

5.1. List

URL: /project/{project_id}/milestones/index

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/milestones/index.json?API_KEY=yourapikey

Example Response:

{
    "data": {
        "paging":{"page":1,"count":5,"limit":"10","pageCount":1},
        "milestones": [
            {
                "Milestone": {
                    "completed_date": "2011-04-22",
                    "created": "2011-04-14 18:47:10",
                    "due_date": "2011-04-30",
                    "executionMetrics": {
                        "executedCases": 6,
                        "failedCases": 0,
                        "passedCases": 6,
                        "pendingCases": 1,
                        "pendingExecutions": 1,
                        "progressPercent": 85.71,
                        "skipCases": 0,
                        "timeSpent": 1571,
                        "totalCases": 7,
                        "totalExecutions": 1
                    },
                    "id": "1",
                    "is_archived": "0",
                    "is_delayed": "0",
                    "project_id": "1",
                    "responsible_user_id": "3",
                    "start_date": "2011-04-14",
                    "status": "0",
                    "title": "Basic development",
                    "user_id": "1"
                }
            }
        ]
    }
}

5.2. Delete

URL: /project/{project_id}/milestones/delete/{milestone_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/milestones/delete/5.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/milestones/index",
    "data": {
        "created_id": null
    },
    "message": "Milestone deleted",
    "status": true
}

5.3. Add

URL: /project/{project_id}/milestones/add

Acceptable POST Parameters:

Name
Is Required?
 Description
Milestone.title Yes Title of the milestone
Milestone.start_date Yes Start date of the milestone
Milestone.due_date Yes Due date of the milestone
Milestone.responsible_user_id Yes ID of the responsible user for finishing this milestone

Example Request:

curl --data '{"data": {"Milestone": {"title": "New Milestone", "start_date":"2012-08-01", "due_date":"2012-08-14", "responsible_user_id": 2}}}' http://your-testcollab-url.com/index.php/project/1/milestones/add.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/milestones/view/4",
    "data": {
        "created_id": "4"
    },
    "message": "The Milestone has been saved",
    "status": true
}

5.4. View

URL: /project/{project_id}/milestones/view/{milestone_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/milestones/view/1.json?API_KEY=yourapikey

Example Response:

{
    data: {
        milestone: {
            Milestone: {
                id: "1",
                title: "M1",
                created: "2015-01-22 00:45:25",
                start_date: "2015-01-01",
                due_date: "2015-01-31",
                user_id: "1",
                responsible_user_id: "1",
                status: "0",
                project_id: "1",
                completed_date: null,
                is_delayed: "0",
                is_archived: "0",
                executionMetrics: {
                    totalExecutions: 1,
                    passedCases: 1,
                    failedCases: 1,
                    skipCases: 0,
                    totalCases: 2,
                    pendingCases: 0,
                    executedCases: 2,
                    timeSpent: 23,
                    pendingExecutions: 0,
                    progressPercent: 100
                }
            },
            Execution: {
            1: {
                id: "1",
                title: "Untitled",
                created: "2015-01-22 00:28:44",
                user_id: "1",
                status: "2",
                project_id: "1",
                milestone_id: "1",
                execution_case_count: "2",
                time_taken: "23",
                stopped: "0",
                stopped_by: null,
                priority: "1",
                executors: {
                    1: "1"
                },
                botExecutors: [ ],
                timeTakenLabel: "23 sec",
                execution_status_Label: "Finished",
                userParamsLabel: "-",
                success_rate: "50%",
                executionMetrics: {
                    passedCases: 1,
                    failedCases: 1,
                    skipCases: 0,
                    totalCases: 2,
                    pendingCases: 0,
                    executedCases: 2,
                    timeSpent: "23"
                },
                labelForPriority: "Normal"
            }
        }
    }
}
}

6. Executions

6.1. List

URL: /project/{project_id}/executions/index

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/executions/index.json?API_KEY=yourapikey

Example Response:

{
    "data": {           
       "paging":{"page":1,"count":5,"limit":"10","pageCount":3},
        "executions": [
            {
                "Execution": {
                    "botExecutors": {
                        "51": "1"
                    },
                    "created": "2011-12-09 08:04:25",
                    "executionMetrics": {
                        "executedCases": 7,
                        "failedCases": 1,
                        "passedCases": 3,
                        "pendingCases": 0,
                        "skipCases": 3,
                        "timeSpent": "120",
                        "totalCases": 7
                    },
                    "execution_case_count": "7",
                    "execution_status_Label": "Finished",
                    "executors": [],
                    "id": "13",
                    "labelForPriority": "Normal",
                    "milestone_id": null,
                    "priority": "1",
                    "project_id": "1",
                    "status": "2",
                    "stopped": "0",
                    "stopped_by": null,
                    "success_rate": "43%",
                    "timeTakenLabel": "2 minutes 0 seconds",
                    "time_taken": "120",
                    "title": "My first automated execution",
                    "userParamsLabel": "-",
                    "user_id": "1"
                },
                "Milestone": {
                    "completed_date": null,
                    "created": null,
                    "due_date": null,
                    "id": null,
                    "is_archived": null,
                    "is_delayed": null,
                    "project_id": null,
                    "responsible_user_id": null,
                    "start_date": null,
                    "status": null,
                    "title": null,
                    "user_id": null
                }
            },
            {
                "Execution": {
                    "botExecutors": [],
                    "created": "2011-04-14 18:49:47",
                    "executionMetrics": {
                        "executedCases": 4,
                        "failedCases": 1,
                        "passedCases": 3,
                        "pendingCases": 1,
                        "skipCases": 0,
                        "timeSpent": "350",
                        "totalCases": 5
                    },
                    "execution_case_count": "5",
                    "execution_status_Label": "Assigned",
                    "executors": {
                        "12": "2",
                        "14": "1"
                    },
                    "id": "3",
                    "labelForPriority": "Low",
                    "milestone_id": null,
                    "priority": "0",
                    "project_id": "1",
                    "status": "0",
                    "stopped": "0",
                    "stopped_by": null,
                    "success_rate": "75%",
                    "timeTakenLabel": "9 minutes 36 seconds",
                    "time_taken": "576",
                    "title": "Basics",
                    "userParamsLabel": "-",
                    "user_id": "1"
                },
                "Milestone": {
                    "completed_date": null,
                    "created": null,
                    "due_date": null,
                    "id": null,
                    "is_archived": null,
                    "is_delayed": null,
                    "project_id": null,
                    "responsible_user_id": null,
                    "start_date": null,
                    "status": null,
                    "title": null,
                    "user_id": null
                }
            }
        ]
    }
}

6.2. View

URL: /project/{project_id}/executions/view/{execution_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/executions/view/1.json?API_KEY=yourapikey

Example Response:

{
    data: {
        execution: {
            Execution: {
                id: "1",
                title: "Untitled",
                created: "2015-01-22 00:28:44",
                user_id: "1",
                status: "2",
                project_id: "1",
                milestone_id: "1",
                execution_case_count: "2",
                time_taken: "23",
                stopped: "0",
                stopped_by: null,
                priority: "1",
                executors: {
                    1: "1"
                },
                botExecutors: [ ],
                timeTakenLabel: "23 sec",
                execution_status_Label: "Finished",
                userParamsLabel: "-",
                success_rate: "50%",
                executionMetrics: {
                    passedCases: 1,
                    failedCases: 1,
                    skipCases: 0,
                    totalCases: 2,
                    pendingCases: 0,
                    executedCases: 2,
                    timeSpent: "23"
                },
                labelForPriority: "Normal"
            },
            Milestone: {
                id: "1",
                title: "M1",
                created: "2015-01-22 00:45:25",
                start_date: "2015-01-01",
                due_date: "2015-01-31",
                user_id: "1",
                responsible_user_id: "1",
                status: "0",
                project_id: "1",
                completed_date: null,
                is_delayed: "0",
                is_archived: "0",
                executionMetrics: {
                    totalExecutions: 1,
                    passedCases: 1,
                    failedCases: 1,
                    skipCases: 0,
                    totalCases: 2,
                    pendingCases: 0,
                    executedCases: 2,
                    timeSpent: 23,
                    pendingExecutions: 0,
                    progressPercent: 100
                }
            },
            ExecutionCase:
            [
            {
                id: "1",
                execution_id: "1",
                test_case_id: "1",
                user_id: "1",
                project_id: "1",
                execution_status: "2",
                sort_order: "1",
                result_status: "1",
                execution_run_count: "1",
                time_taken: "13",
                is_stopped: "0",
                remote_executor_id: null,
                execution_started: "2015-01-22 00:29:28",
                result_status_label: "Pass",
                lastExecutionRun: {
                    id: "1",
                    execution_case_id: "1",
                    user_id: "1",
                    started: "2015-01-22 00:29:28",
                    ended: "2015-01-22 00:29:44",
                    result: "1",
                    notes: "test notes",
                    created: "2015-01-22 00:29:44",
                    defect_id: null,
                    time_taken: "13",
                    project_id: "1",
                    remote_executor_id: null,
                    test_case_revision_id: "1",
                    result_label: "Pass"
                }
            },
            {
                id: "2",
                execution_id: "1",
                test_case_id: "2",
                user_id: "1",
                project_id: "1",
                execution_status: "2",
                sort_order: "2",
                result_status: "0",
                execution_run_count: "2",
                time_taken: "10",
                is_stopped: "0",
                remote_executor_id: null,
                execution_started: "2015-01-22 00:32:10",
                result_status_label: "Fail",
                lastExecutionRun: {
                    id: "3",
                    execution_case_id: "2",
                    user_id: "1",
                    started: "2015-01-22 00:32:11",
                    ended: "2015-01-22 00:32:17",
                    result: "0",
                    notes: "test",
                    created: "2015-01-22 00:32:17",
                    defect_id: "1",
                    time_taken: "4",
                    project_id: "1",
                    remote_executor_id: null,
                    test_case_revision_id: "2",
                    result_label: "Fail"
                }
            }
        ]
        }
    }
}

6.3. Add

URL: /project/{project_id}/executions/add

Acceptable POST Parameters:

Name
Is Required?
 Description
Execution.title Yes Title of the execution
Execution.priority Yes Execution's priority; 0 = low, 1 = normal, 2 = high
Execution.milestone_id No Milestone ID of test execution if it belongs to any.

Example Request:

curl --data '{"data": {"Execution": {"title":"New Execution","priority":"1","milestone_id": "6" }}}' http://your-testcollab-url.com/index.php/project/1/executions/add.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/executions/assignTest/15/milestoneId:6/projectId:1",
    "data": {
        "created_id": "15"
    },
    "message": "The Execution has been saved!",
    "status": true
}

6.4. Assign

URL: /project/{project_id}/executions/assignTest/{execution_id}

Acceptable POST Parameters:

Name
Required?
 Description
Execution.assign_map Yes This parameter contains JSON-formatted object to indicate which users are assigned to which test cases or test suites. Based on number of test executors, it can contain multiple entries like these:
"User_2":{"suites":["1"],"testCases":[5,7]}
The above object indicates that user with id "2" is assigned test suite "1" and test cases "5" and "7" for execution. This provides granual access for assigning desired test cases to specific user(s). Executions can also be assigned to remote executors / bots like these:
"RemoteExecutor_1":{"suites":["2"],"testCases":[]}

Example Request:

curl --data '{"data": {"Execution": {"assign_map": {"User_2":{"suites":["1"],"testCases":[5,7]},"User_1":{"suites":[],"testCases":[4,6]},"RemoteExecutor_1":{"suites":[],"testCases":[]}}}}}' http://your-testcollab-url.com/index.php/project/1/executions/assignTest/18.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/executions/index",
    "data": {
        "created_id": null
    },
    "message": "Tests have been assigned.",
    "status": true
}

6.5. Run/Execute

URL: /project/{project_id}/executions/run/{execution_case_id}/1

Once an execution has been created and assigned, execution_case_id can be fetched from information returned from view call.

Acceptable POST Parameters:

Name 
Required? 
 Description
ExecutionRun.notes No Any note or comment for execution of case
ExecutionRun.result Yes Result can be; 0 = Failed, 1 = Passed, 2 = Skipped
ExecutionRun.time_taken No Time taken to run test in seconds.

ExecutionRun.add_defect  No 1 if failure should be reported to integrated issue manager
ExecutionRun.attachments.{n}.name No Attachments hashes returned  from uploading files to test collab server. Here {n} should replaced an index key. There can be multiple attachments

Example Request: 

If you want to attach any artefact with the result then use the following command template:  

curl --data '{"data": {"ExecutionRun": {"notes":"Your note","result":"1","time_taken": "80", "add_defect":0,"attachments":[{"name": "filehash"}] }}}' http://your-testcollab-url.com/index.php/project/{project_id}/executions/run/{execution_case_id}/1.json?API_KEY=yourapikey 

Command template to be used when no attachment is there: 

curl --data '{"data": {"ExecutionRun": {"notes":"Your note","result":"1","time_taken": "80", "add_defect":0}}}' http://your-testcollab-url.com/index.php/project/{project_id}/executions/run/{execution_case_id}/1.json?API_KEY=yourapikey 

Example Response: 

{"data":{"result":{"ok":true,"nextExecutionCaseId":34}}} 

nextExecutionCaseId will contain id of next execution casse id which should be executed. If all execution cases have been completed then nextExecutionCaseId will be false. 

6.6. Execution Case Logs View

URL: /project/{project_id}/execution_case_logs/index/{execution_case_log_id}

/project/1/

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/execution_case_logs/index/2.json?API_KEY=yourapikey

Example Response:

{
    "data": {
        "executionCaseLogs": [
        {
            "ExecutionCaseLog": {
                "id": "2",
                "type": "1",
                "execution_case_id": "2",
                "params": [],
                "created": "2015-01-22 00:29:51",
                "comment": "test",
                "project_id": "1",
                "user_id": "1",
                "execution_run_id": "2",
                "remote_executor_id": null,
                "type_text": "Execution Run"
            },
            "ExecutionRun": {
                "id": "2",
                "execution_case_id": "2",
                "user_id": "1",
                "started": "2015-01-22 00:29:44",
                "ended": "2015-01-22 00:29:51",
                "result": "0",
                "notes": "test",
                "created": "2015-01-22 00:29:51",
                "defect_id": null,
                "time_taken": "6",
                "project_id": "1",
                "remote_executor_id": null,
                "test_case_revision_id": "2",
                "result_label": "Fail"
            },
            "Attachment": [],
            "TestCaseRevision": {
                "id": "2",
                "test_case_id": "2",
               "created": "2015-01-22 00:28:29",
               "user_id": "1",
               "revision_number": "1",
               "comment": null
           }
    },
    {
        "ExecutionCaseLog": {
            "id": "3",
            "type": "6",
            "execution_case_id": "2",
            "params": [],
            "created": "2015-01-22 00:32:01",
            "comment": "Bulk action - reassign",
            "project_id": "1",
            "user_id": "1",
            "execution_run_id": null,
            "remote_executor_id": null,
            "type_text": "Retest"
        },
        "Attachment": []
    },
    {
        "ExecutionCaseLog": {
            "id": "4",
            "type": "1",
            "execution_case_id": "2",
            "params": [],
            "created": "2015-01-22 00:32:17",
            "comment": "test",
            "project_id": "1",
            "user_id": "1",
            "execution_run_id": "3",
            "remote_executor_id": null,
            "type_text": "Execution Run"
        },
        "ExecutionRun": {
            "id": "3",
            "execution_case_id": "2",
            "user_id": "1",
            "started": "2015-01-22 00:32:11",
            "ended": "2015-01-22 00:32:17",
            "result": "0",
            "notes": "test",
            "created": "2015-01-22 00:32:17",
            "defect_id": "1",
            "time_taken": "4",
            "project_id": "1",
            "remote_executor_id": null,
            "test_case_revision_id": "2",
            "result_label": "Fail"
        },
        "Attachment": [],
        "TestCaseRevision": {
            "id": "2",
            "test_case_id": "2",
            "created": "2015-01-22 00:28:29",
            "user_id": "1",
            "revision_number": "1",
            "comment": null
        }
    }
    ]
}
}

Notice the value of "type" under "ExecutionCaseLog", the value here represents the type of activity which has performed on execution case : 

1 indicates that execution case has been run

2 indicates that execution case has been reassigned

3 indicates that execution case has been commented on

4 indicates that execution case has been marked as passed

indicates that execution case has been marked as failed

indicates that execution case has been marked for retest

 

6.7. Defects View

URL: /project/{project_id}/defects/view/{defect_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/defects/view/1.json?API_KEY=yourapikey

Example Response:

{
    "data": {
        "defect": {
            "Defect": {
                "id": "1",
                "project_id": "1",
                "execution_run_id": "3",
                "defect": "7266",
                "status": "1",
                "created": "2015-01-22 00:32:17",
                "issue_created": "2015-01-22 00:32:19",
                "defectUrl": "http://projects.gigapromoters.com/issues/7266"
            }
        }
    }
}

6.8. Delete

URL: /project/{project_id}executions/delete/{execution_id}

Example Request:

curl http://your-testcollab-url.com/index.php/project/1/executions/delete/1.json?API_KEY=yourapikey

Example Response:

{
    "appState": "/project/1/executions/index",
    "data": {
        "created_id": null
    },
    "message": "Execution deleted!",
    "status": true
}

7. Attachments

7.1. Upload

To associate files with Test Cases and Executions. they should be uploaded through an API call first and then the returned file hash should be sent in post data of API call in which you want the file to get associated.

Request and return format of uploading attachments is different than other API calls.

URL: /api/upload/{YOUR_API_KEY}

In this request, API key should be sent in the URL itself. instead of $_GET parameter. 

Request should be simple post, no json is required.

File content should be sent in "file" key of post.

Please see the example below:

Example Request:

curl  -F file=@"~/Desktop/image.png" http://your-testcollab-url.com/index.php/api/upload/yourapikey

Example Response:

{"response":{"message":"File uploaded.","filehash":"fgzwncpx88fh4gp"},"status":"pass"}

 filehash should be passed in your Test Case or Execution Case to associate that Attachment.

Test Case Management
Test Collab Support
Product Tour