Menu

Common APIs

Revision table

# Release Date API New or Update Description of Change
1 4/29/2016 Get all Comments of a Requirement, Test Case, Test Run or Defect New  
2 4/29/2016 Get one Comment of a Requirement, Test Case, Test Run or Defect New  
3 4/29/2016 Add a Comment to a Requirement, Test Case, Test Run or Defect New  
4 4/29/2016 Update a Comment of a Requirement, Test Case, Test Run or Defect New  
5 4/29/2016 Delete a Comment of a Requirement, Test Case, Test Run or Defect New  
6 4/29/2016 Download An Attachment from a Release, Build, Requirement, Test Case, Test Log, Test Step or Defect Update The following information is added:
  • author: the user who uploaded the attachment
  • created_date: the date on which the attachment was uploaded
7 4/29/2016 Delete an Attachment from a Release, Build, Requirement, Test Case, or Defect New  
8 4/29/2016 Retrieve associated objects of given objects New  
9 5/23/2016 Query objects New  
10 5/23/2016 Query objects' history New  
11 5/23/2016 Query comments New  
12 5/23/2016 Query Attachments New  
13 5/23/2016 Retrieve associated objects of given objects Update Retrieve associated Defects of Test Logs or Test Step Logs
14 5/23/2016 Create Links Between Objects New  
15 5/23/2016 Remove Links Between Objects New  

 

Login

This API was deprecated. Check out the new login API.

POST /api/login

qTest version: 4+

Description: Authenticate the API client with qTest, and acquire the authorization token.

Request sample:

POST /api/login  
Host: nephele.qtestnet.com  
Cache-Control: no-cache  
Content-Type: application/x-www-form-urlencoded  
j_username= maxmccloud%40qasymphony.com&j_password=p@ssw0rd  

Response sample:

 HTTP/1.1 200  OK  
 Access-Control-Allow-Origin: *  
 Authorization: --  
 NWRjZGRhMDVkMzQwYTdjZTU5NmU  
 Cache-Control: no-cache  
 Content-Length: 107  
 Date: Tue, 25 Mar 2014 02:41:59 GMT  
 Server: Apache-Coyote/1.1  
 x-explorer-status: 1  
 bmVwaGVsZXxtYXhtY2Nsb3VkQHFhc3ltcGhvbnkuY29tOjEzOTU4MDE3MjAwODQ6NjZjNGY4MGVjYjA  
 0NWRjZGRhMDVkMzQwYTdjZTU5NmU  

Login (new version)

POST /oauth/token

qTest version: 7+

Description: Authenticate the API client with qTest, and acquire the authorization token.

Request Authorization Header: It includes a username (any string representing your API client name) encoded following Basic Access Authentication protocol.

Password must not be filled in or the API will not work.

Request Body: You will need to include your qTest credentials in the request body with x-www-form-urlencoded content type.

Key Required Description
grant_type yes Always pass in "password" for this key.
username yes Your qTest username
password yes Your qTest password

Get Access Token

Request Sample:

POST /oauth/token
Host: nephele.qtestnet.com
Authorization: Basic bGluaC1sb2dpbjo=
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
--Request body starts from here
grant_type=password&username=---%40gmail.com&password=---

Response Body: token_type and access_token are included in the reponse. Use them in Authorization key when sending request APIs to qTest in following format: [token_type] [access_token]

Response Sample:

{
    "access_token": "---",
    "token_type": "bearer",
    "expires_in": 3599,
    "scope": "read write create delete administration execute import export share baseline"
}

Revoke token (Logout)

POST /oauth/revoke

qTest version: 7+

Description: To revoke a token or terminate an active session.

Request sample:

POST /oauth/revoke
Host: qtest-dev.qtestnet.com
Authorization: bearer [token to be revoked]
Cache-Control: no-cache

Get Token Status

GET /oauth/status

qTest version: 7+

Description: To check when the token expires if its session stays idle.

Request sample:

GET /oauth/status
Host: qtest-dev.qtestnet.com
Authorization: bearer [token]
Cache-Control: no-cache

Response body:

Key Description
expiration The timestamp at which the token will expires if its session keeps staying idle. If it is 0 (zero), the token will never expire.
validityInMiliseconds How long the token will be valid if its session stays idle. If it is 0, the token will never expire.

Response sample:

{
    "expiration": 1450169265371,
    "validityInMilliseconds": 5231322
}

List all projects

GET /api/v3/projects

qTest version: 4+

Description: To get the list of projects with ID that the requested account can access.

Request sample:

 GET /api/v3/projects 
 Host: nephele.qtestnet.com  
 Authorization: bearer [token]  
 DVkMzQwYTdjZTU5NmU  
 Cache-Control: no-cache  

Response sample:

HTTP/1.1 200  OK  
Cache-Control: no-cache  
Content-Type: application/json;charset=UTF-8  
Date: Tue, 25 Mar 2014 02:59:25 GMT  
Expires: Thu, 01 Jan 1970 00:00:00 GMT  
Pragma: no-cache  
Server: Apache-Coyote/1.1  
Transfer-Encoding: chunked   
[
  {
    "links": [
      {
        "rel": "self",
        "href": "http://nephele.qtestnet.com/api/v3/projects/1"
      },
      {
        "rel": "test-cases",
        "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-cases"
      }
    ],
    "id": 1,
    "name": "qConnect - Sample Project",
    "description": "qConnect is a professional network to connects you to your trusted    contacts and helps you exchange knowledge, ideas, and opportunities with a broader network of professionals.",
    "sample": true,
    "status_id": 101,
    "start_date": "12/10/2012",
    "end_date": "12/10/2015",
    "defect_tracking_systems": [
      {
        "url": "http://192.168.76.72:10614",
        "active": false,
        "id": 33,
        "connection_name": "JIRA connection",
        "system_name": "Jira5"
      },
      {
        "url": "http://192.168.76.72:10445",
        "active": false,
        "id": 38,
        "connection_name": "JIRA connection",
        "system_name": "Jira4"
      },
      {
        "url": "http://192.168.76.72:10606",
        "active": false,
        "id": 68,
        "connection_name": "JIRA connection",
        "system_name": "Jira5"
      },
      {
        "url": "http://192.168.25.45/",
        "active": false,
        "id": 133,
        "connection_name": "FogBugz @ http://192.168.25.45/",
        "system_name": "Fogbugz"
      },
      {
        "url": "http://192.168.45.39:8080",
        "active": true,
        "id": 134,
        "connection_name": "JIRA connection",
        "system_name": "Jira4"
      }
    ]
  }
]

Get current user permission

GET /api/v3/projects/{projectId}/user-profiles/current

qTest version: 4+

Description: to get all permissions of the current user.

Path variable:

  • projectId: ID of the project

Response body:

Property Data Type Description
user_id long  
project_id long  
module JSON object contains boolean properties: create/edit/delete/view
requirement JSON object contains boolean properties: create/edit/delete/view/export/import
test_case JSON object contains boolean properties: create/edit/delete/view/export/approve/import
test_run JSON object contains boolean properties: create/edit/delete/view/execute/export
defect JSON object contains boolean properties: create/edit/delete/view/export

Request sample:

 GET /api/v3/projects/1/user-profiles/current  
 Host: localhost:8082  
 Authorization: bearer [token]  
 Cache-Control: no-cache  
 Content-Type: application/x-www-form-urlencoded  

Response sample:

 Cache-Control: no-cache  
 Content-Type: application/json;charset=UTF-8  
 Date: Thu, 10 Apr 2014 09:14:19 GMT  
 Expires: Thu, 01 Jan 1970 00:00:00 GMT  
 Pragma: no-cache  
 Server: Apache-Coyote/1.1  
 Transfer-Encoding: chunked  
 {  
  "user_id": 36,  
  "project_id": 1,  
  "module": {  
    "create": false,  
    "edit": false,  
    "delete": false,  
    "view": true  
  },  
  "requirement": {  
    "create": false,  
    "edit": false,  
    "delete": false,  
    "view": true,  
    "export": true,  
    "import": false  
  },  
  "test_case": {  
    "create": true,  
    "edit": true,  
    "delete": true,  
    "view": true,  
    "export": true,  
    "approve": true,  
    "import": false  
  },  
  "test_run": {  
    "create": true,  
    "edit": true,  
    "delete": true,  
    "view": true,  
    "execute": true,  
    "export": true  
  },  
  "defect": {  
    "create": true,  
    "edit": true,  
    "delete": false,  
    "view": true,  
    "export": true  
  }  
 }  

Create A New Project

POST /api/v3/projects

qTest version: 4+

Description: To create a new project. The project's properties (name, description, start_date, end_date, and admins) are specified in the request body.

Request sample:

 POST /api/v3/projects HTTP/1.1  
 Host: 192.168.74.69:8486  
 Authorization: bearer [token] 
 Content-Type: Application/json  
 Cache-Control: no-cache  
 { 
	 "name": "Project created from API", 
	 "description": "new project description", 
	 "start_date": "2015-04-24T17:00:00Z", 
	 "end_date": "2016-04-24T17:00:00Z", 
	 "admins": ["maxmccloud@qasymphony.com"],
"automation":true }

Response sample:

 {  
      "links": [  
      {  
           "rel": "self",  
           "href": "http://localhost:8080/api/v3/projects/246"  
      }  
      ],  
      "id": 246,  
      "name": "Project created from API",  
      "description": "new project description",  
      "start_date": "2015-04-24T17:00:00+00:00",
"automation":true }

User Invitation

POST /api/v3/users

qTest version: 4+

Description: To invite a user to qTest and activate the account. If the password is omitted, the default "admin123" will be used.

Request sample:

 POST /api/v3/users HTTP/1.1  
 Host: 192.168.74.69:8487  
 Authorization: bearer [token]  
 Content-Type: application/json  
 Cache-Control: no-cache  
 { 
	 "username": "loicao7@yopmail.com", 
	 "first_name": "First Name",   
	 "last_name": "Last Name", 
	 "email": "loicaoabc@yopmail.com", 
	 "password": "loicao" 
 }  

Response sample:

{  
	 "links": [],  
	 "username": "loicao7@yopmail.com",  
	 "email": "loicaoabc@yopmail.com",  
	 "password": "loicao",  
	 "id": 54,  
	 "first_name": "First Name",  
	 "last_name": "Last Name"  
}  

Assign Users To A Project

POST /api/v3/users/projects

qTest version: 4+

Description: To assign a list of users to a project. The project ID and user IDs are specified in the request body.

Request sample:

 POST /api/v3/users/projects HTTP/1.1  
 Host: localhost:8080  
 Authorization: bearer [token]  
 Content-Type: application/json  
 Cache-Control: no-cache  
 { 
	"project_id": 1751, 
	"user_ids": [124] 
 }  

Response sample:

 {  
	 "profile": {  
		 "id": 2,  
		 "name": "Developer"  
	 },  
	 "project_id": 1751,  
	 "user_ids": [  
		 124  
	 ]  
 }  

Attach a file to Test Case, Test Log, Test Step

Important_icon.pngImportant:

  • These APIs are deprecated in our new qTest version. It is recommended that you use the other APIs described below.

POST api/v3/projects/{projectId}/test-cases/{objectId}/attachments
POST api/v3/projects/{projectId}/test-steps/{objectId}/attachments
POST api/v3/projects/{projectId}/test-logs/{objectId}/attachments

qTest version: 4+

Description:To attach a file to an object.

Path variable:

  • projectId: ID of the project
  • objectId: ID of the object (test case, test step or test log)

Request sample:

POST /api/v3/projects/12833/test-cases/1016045/attachments HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token] 
Cache-Control: no-cache

----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="file"; filename="QAS.xml"
Content-Type: text/xml


----WebKitFormBoundaryE19zNvXGzXaLvS5C 

Response sample:

 HTTP/1.1 201  CREATED  
 Cache-Control: no-cache  
 Content-Type: application/pdf  
 Date: Tue, 25 Mar 2014 04:29:52 GMT  
 Expires: Thu, 01 Jan 1970 00:00:00 GMT  
 Pragma: no-cache  
 Server: Apache-Coyote/1.1  
 Transfer-Encoding: chunked  
 {
    "links": [],
    "name": "QAS.xml",
    "id": 151244
 }

Upload An Attachment to A Release, Build, Requirement, Test Case, Test Log, Test Step, or Defect

POST /api/v3/projects/{projectId}/{objectType}/{objectId}/blob-handles

qTest version: 4+

Path variable:

  • projectId: ID of the project
  • objectType: it can be one of these types: releases, builds, requirements, test-cases, test-logs, test-steps or defects
  • objectId: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step or Defect)

Request body: the attachment content

Request sample:

 POST /api/v3/projects/1/defects/1/blob-handles HTTP/1.1  
 Host: localhost:8080  
 Authorization: bearer [token]  
 Content-Type: application/jpeg  
 File-Name: testuploadfile.jpg  
 Cache-Control: no-cache  
 abcdasfsafsfsafsafsfQWEERqwefskjkloiopiojuhyewmxcncidjfskoqnayuhwlsoaskdfhsfasfwe  

Response sample:

 {  
	 "links": [],  
	 "name": "testuploadfile.jpg",  
	 "id": 171  
 }  

Download An Attachment from a Release, Build, Requirement, Test Case, Test Log, Test Step or Defect

GET /api/v3/projects/{projectId}/{artifact-type}/{objectId}/attachments

qTest version: 6+

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be release, build, requirements, test-cases, test-logs, test-steps, or defects
  • objectId: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step or Defect)

Request sample:

GET /api/v3/projects/1/test-cases/123/attachments
 Host: localhost:8082  
 Authorization: bearer [token]
 Cache-Control: no-cache  
 Content-Type: application/x-www-form-urlencoded  

Response sample:

[
  {
    "links": [
      {
        "rel": "self",
        "href": "http://nephele.qtestdev.com/api/v3/projects/1/test-cases/23537/attachments/2556"
      },
      {
        "rel": "author",
        "href": "http://nephele.qtestdev.com/api/v3/users/588"
      }
    ],
    "name": "MUST READ.txt",
    "content_type": "text/plain",
    "id": 2556,
    "web_url": "https://nephele.qtestdev.com/p/1/portal/attachment/testcase/attachmentId/2556",
    "created_date": "2016-04-26T16:08:45+12:00",
    "author": {
      "id": 588,
      "email": "tuantran@qasymphony.com",
      "first_name": "Tuan",
      "last_name": "Tran"
    }
  }
]

Then use the web_url to download the attachment.

Delete an Attachment from a Release, Build, Requirement, Test Case, or Defect

DELETE /api/v3/projects/{projectId}/{artifact-type}/{objectId}/blob-handles/{blobhandleId}

qTest version: 7.5+

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be release, build, requirements, test-cases, test-logs, test-steps, or defects
  • objectId: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step or Defect)
  • blobhandleId: ID of the attachment

Request sample:

DELETE /api/v3/projects/1/requirements/2/blob-handles/3 HTTP/1.1
Host: nephele.qtestdev.com
Authorization: bearer [token]

Retrieve associated objects of given objects

GET /api/v3/projects/{projectId}/linked-artifacts?type={objectType}&ids={artifactId1,artifactId2}

qTest version: 7.5+

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
type yes It can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects
ids no IDs of objects whose links you want to retrieve

Request sample:

GET /api/v3/projects/1/linked-artifacts?type=defects&ids=40,41
Host: 192.168.74.105:8486
Authorization: bearer [token]

Response sample:

[
  {
    "id": 40,
    "objects": [
      {
        "id": 214,
        "pid": "TRUN-144",
        "link_type": "is_associated_with",
        "self": "http://192.168.74.105:8486/tc/api/v3/projects/4/test-runs/214"
      },
      {
        "id": 216,
        "pid": "TRUN-146",
        "link_type": "is_associated_with",
        "self": "http://192.168.74.105:8486/tc/api/v3/projects/4/test-runs/216"
      }
    ]
  },
  {
    "id": 41,
    "objects": [
      {
        "id": 214,
        "pid": "TRUN-144",
        "link_type": "is_associated_with",
        "self": "http://192.168.74.105:8486/tc/api/v3/projects/4/test-runs/214"
      }
    ]
  }
]

See below table for avaible link types between objects

Artifact type Link type Associated artifact type
releases release scope includes requirements
builds build scope includes requirements
requirements is covered by test-cases
requirements is included in releases
requirements is included in builds
test-cases covers requirements
test-cases is associated with test-runs
test-runs is created from test-cases
test-runs is associated with defects
defects is associated with test-runs
defects is associated with test-logs
defects is associated with test-steps
test-logs is associated with defects
stest-steps is associated with defect

Create A New Custom Field

POST /api/v3/projects/{projectId}/settings/releases/fields
POST /api/v3/projects/{projectId}/settings/builds/fields
POST /api/v3/projects/{projectId}/settings/requirements/fields
POST /api/v3/projects/{projectId}/settings/test-cases/fields
POST /api/v3/projects/{projectId}/settings/test-suites/fields
POST /api/v3/projects/{projectId}/settings/test-runs/fields
POST /api/v3/projects/{projectId}/settings/defects/fields

qTest version: 4+

Description: To create a new custom field for Release, Build, Requirement, Test Case, Test Suite, Test Run, Defect.

Path variable:

  • projectId: ID of the project

Request sample:

 POST /api/v3/projects/1/settings/requirements/fields HTTP/1.1  
 Host: localhost:8080  
 Authorization: bearer [token] 
 Content-Type: application/json  
 Cache-Control: no-cache  
 { "label": "New Checkbox Field", 
 "required": true, 
 "searchable": true, 
 "free_text_search": true,   
 "search_key": "opp", 
 "data_type": 8,   
 "allowed_values": 
	 [{"label": "Chrome", 
	 "is_default": true, 
	 "is_active": true},   
	 {"label": "Firefox", 
	 "is_active": true}] 
 }  

Response sample:

 {  
      "links": [  
      {  
           "rel": "self",  
           "href": "http://localhost:8080/api/v3/projects/1/defects/fields/10786"  
      }  
      ],  
      "id": 10786,  
      "label": "New Checkbox Field",  
      "required": true,  
      "constrained": true,  
      "order": 29,  
      "multiple": true,  
      "searchable": true,  
      "attribute_type": "ArrayNumber",  
      "allowed_values": [  
      {  
           "links": [],  
           "value": 1,  
           "label": "Chrome",  
           "order": 1,  
           "is_default": true,  
           "is_active": true  
      },  
      {  
           "links": [],  
           "value": 2,  
           "label": "Firefox",  
           "order": 2,  
           "is_default": false,  
           "is_active": true  
      }  
      ],  
      "data_type": 8,  
      "free_text_search": true  
 }  

Get all Comments of a Requirement, Test Case, Test Run or Defect

GET /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments

GET /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments

qTest version: 7.5+

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be requirements, test-cases, test-runs, or defects
  • PID or ID: the PID or ID of the object whose comments you want to retrieve

Request Parameter:

Parameter Required Description
size no The result is paginated. By the default, the number of test cases in each page is 100. You can specify your custom number in this parameter. The maximum page size is 1000
page no By default the first page is returned. However, you can specify any page number to retrieve test cases.

Request sample:

GET /api/v3/projects/1/test-runs/1/comments/5 HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache

Response sample:

{
  "links": [],
  "page": 1,
  "pageSize": 100,
  "total": 2,
  "items": [
    {
      "created": "2016-03-23T07:38:56+00:00",
      "userId": 2,
      "links": [
        {
          "rel": "self",
          "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/5"
        },
        {
          "rel": "test-run",
          "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
        }
      ],
      "id": 5,
      "content": "this is a test run's comment"
    },
    {
      "created": "2016-03-23T07:38:56+00:00",
      "userId": 2,
      "links": [
        {
          "rel": "self",
          "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/6"
        },
        {
          "rel": "test-run",
          "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
        }
      ],
      "id": 6,
      "content": "this is another comment"
    }
  ]
}

Get one Comment of a Requirement, Test Case, Test Run or Defect

GET /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments/{commentId}

GET /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments/{commentId}

qTest version: 7.5+

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be requirements, test-cases, test-runs, or defects
  • PID or ID: the PID or ID of the object whose comment you want to retrieve
  • commentId: ID of the comment which you want to retrieve

Request sample:

GET /api/v3/projects/1/test-runs/1/comments HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache

Response sample:

{
  "created": "2016-03-23T07:38:56+00:00",
  "userId": 2,
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/5"
    },
    {
      "rel": "test-run",
      "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
    }
  ],
  "id": 5,
  "content": "This is a comment"
}

Add a Comment to a Requirement, Test Case, Test Run or Defect

POST /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments

POST /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments

qTest version: 7.5+

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be requirements, test-cases, test-runs, or defects
  • PID or ID: the PID or ID of the object to which you want to post the comment

Request sample:

POST /api/v3/projects/1/test-runs/1/comments HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json

{
    "content": "This is a comment"
}

Response sample:

{
  "created": "2016-04-20T04:34:14+00:00",
  "userId": 2,
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/51"
    },
    {
      "rel": "test-run",
      "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
    }
  ],
  "id": 51,
  "content": "This is a comment"
}

Update a Comment of a Requirement, Test Case, Test Run or Defect

PUT /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments/{commentId}

PUT /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments/{commentId}

qTest version: 7.5+

Description: Author of a comment is able to update it

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be requirements, test-cases, test-runs, or defects
  • PID or ID: the PID or ID of the object whose comment you want to update
  • commentId: ID of the comment which you want to update

Request sample:

PUT /api/v3/projects/1/test-runs/1/comments/{29}  HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
{
    "content": "update a comment"
}

Response sample:

{
  "created": "2016-03-25T10:46:01+00:00",
  "updated": "2016-04-20T04:37:36+00:00",
  "userId": 2,
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/29"
    },
    {
      "rel": "test-run",
      "href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
    }
  ],
  "id": 29,
  "content": "commented here for testrun change."
}

Delete a Comment of a Requirement, Test Case, Test Run or Defect

DELETE /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments/{commentId}

DELETE /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments/{commentId}

qTest version: 7.5+

Description: Author of a comment is able to delete it

Path variable:

  • projectId: ID of the project
  • artifact-type: it can be requirements, test-cases, test-runs, or defects
  • PID or ID: the PID or ID of the object whose comment you want to delete
  • commentId: ID of the comment which you want to delete

Request sample:

DELETE /api/v3/projects/1/test-runs/1/comments/{29}  HTTP/1.1
Authorization: bearer [token]

Query objects

POST /api/v3/projects/{projectId}/search

qTest version: 7.6+

Description: This API mimic the Data Query function of qTest web app. It provides the capability to query Requirements, Test Cases, Test Runs and internal Defects.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
pageSize no The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 100.
page no By default the first page is returned. However, you can specify any page number to retrieve objects.

Request body:

Attribute Name Required Type Description
object_type yes String Its value can be requirements, test-cases, test-runs, or defects
fields no String Specify which object fields you want to include in the response. If you ommit it or specify an asterisk (*), all fields are included.
query no String Specify a structured query to search for qTest objects. Basically, you can use the Query Summary text in qTest web app as in the below image for this attribute.

  IMPORTANT: When using Query Summary to specify the query, you will need to modify the Query Summary in some special cases as below:

  • If there are spaces in the criteria name, put it between ''
  • There need to be spaces between a criteria, operator and value
  • You can use field name, field Id or its search key in the query
  • You can use a value text or its Id in the query
  • For date time typed fields: you will need to convert the values to ISO Date Time format
  • Affected Release/Build: if you want to query Defects by their affected release, use Affected Release instead. Otherwise, use Affected Build
  • Target Release/Build: similarly, you will need to break it down to Target Release and Target Build
  • Fixed Release/Build: similarly, you will need to break it down to Fixed Release and Fixed Build
  • Subscriber: modify it to Subscribers and use user Id instead of user name to query
  • You will need to use object Id when querying using these fields: Id, Affected Release, Affected Buid, Target Release, Target Buid, Fixed Release and Fixed Build
  • Modify operator contains to ~, and modify operator not contains to !~. Eg: instead of Name contains "login", change it to Name ~ "login"
  • Modify operator is not empty to is 'not empty'. Eg: Name is 'not empty'

Query Summary

Request sample:

POST /api/v3/projects/5582/search HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json

{
  "object_type": "requirements",
  "fields": ["*"],
  "query": "'id' = '262760'"
} 

Response sample:

{
  "links": [],
  "page": 1,
  "page_size": 100,
  "total": 1,
  "items": [
    {
      "links": [
        {
          "rel": "self",
          "href": "http://nephele.qtestnet.com/api/v3/projects/5582/requirements/262760"
        },
        {
          "rel": "module",
          "href": "http://nephele.qtestnet.com/api/v3/projects/5582/modules/95539"
        }
      ],
      "id": 262760,
      "name": "Install the app using adb",
      "order": 28,
      "pid": "REQS-1",
      "properties": [
        {
          "field_id": 116609,
          "field_value": "911"
        },
        {
          "field_id": 116611,
          "field_value": "901"
        },
        {
          "field_id": 116610,
          "field_value": "802"
        },
        {
          "field_id": 116612,
          "field_value": "[3754]"
        },
        {
          "field_id": 116616,
          "field_value": ""
        }
      ],
      "web_url": "https://nephele.qtestnet.com/p/5582/portal/project#tab=requirements&object=5&id=262760"
    }
  ]
}

Query objects' history

POST /api/v3/projects/{projectId}/histories

qTest version: 7.6+

Description: to query history of Requirements, Test Cases, Test Runs and internal Defects

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
pageSize no The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 100.
page no By default the first page is returned. However, you can specify any page number to retrieve objects.

Request body:

Attribute Name Required Type Description
object_type yes String Its value can be requirements, test-cases, test-runs, or defects
fields no String Specify which object fields you want to include in the response. If you ommit it or specify an asterisk (*), all fields are included.
object_query no String Specify a structured query to search for qTest objects. Refer to attribute query in the Request Body of Query Objects API
query no String Specify a structured query to retrieve history of objects specified in attribute object_query above

Only these 2 criteria are supported:

  • created: it can be used for querying by updated date of the object. Its values need to be in ISO Date format. Applicable operator include: =, <>, <= and >=
  • author: it can be used for querying by Id of the users who made the update. Applicable operators include: = and <>

You can use operators and and or to combine an unlimited number of criteria above

Request sample:

POST /api/v3/projects/5582/histories HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json

{
  "object_type": "requirements",
  "fields": ["*"],
  "object_query": "id = 2145792",
  "query": "created > 2014-04-21T00:00:00+00:00 and author <> 588"
}

Response sample:

{
  "links": [],
  "page": 1,
  "page_size": 100,
  "total": 2,
  "items": [
    {
      "created": "2016-04-28T15:29:49+07:00",
      "links": [],
      "id": 17068846,
      "author_id": 18476,
      "linked_object": {
        "object_id": 2145792
      },
      "changes": [
        {
          "field": "Name",
          "old_value": "Untitled",
          "new_value": "REQ 4"
        }
      ]
    },
    {
      "created": "2016-04-28T15:29:43+07:00",
      "links": [],
      "id": 17068836,
      "author_id": 18476,
      "linked_object": {
        "object_id": 2145792
      },
      "changes": [
        {
          "field": "Type",
          "old_value": "",
          "new_value": "Functional"
        },
        {
          "field": "Name",
          "old_value": "",
          "new_value": "Untitled"
        },
        {
          "field": "Priority",
          "old_value": "",
          "new_value": "Must have"
        },
        {
          "field": "Status",
          "old_value": "",
          "new_value": "New"
        }
      ]
    }
  ]
}

Query Attachments

GET /api/v3/projects/{projectId}/attachments

qTest version: 7.6+

Description: To query attachments

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
type yes It can be releases, builds, requirements, test-cases, test-steps, test-logs or defects
ids no List of object ids, separated by commas
author no Id of the user who created the attachment
createdDate no Its format is: {operator} {date value encoded in ISO format}

The operator can be one of the following values:

  • lt: less than the given date
  • gt: greater than given date
  • eq: equal to the given date
  • le: less than or equal to the given date
  • ge: greater then or equal to the given date
pageSize no The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 100.
page no By default the first page is returned. However, you can specify any page number to retrieve objects.

Request sample:

GET /api/v3/projects/5582/attachments?type=requirements&ids=262760&author=588&createdDate=lt%3A2017-04-21T00%3A00%3A00%2B00%3A00&page=1&pageSize=100 HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token]

Response sample:

{
  "links": [],
  "page": 1,
  "page_size": 100,
  "total": 1,
  "items": [
    {
      "links": [
        {
          "rel": "self",
          "href": "http://nephele.qtestnet.com/api/v3/projects/5582/requirements/262760/attachments/44488"
        }
      ],
      "name": "Snap 2014-05-08 at 18.25.37.png",
      "content_type": "image/png",
      "id": 44488,
      "web_url": "https://nephele.qtestnet.com/p/5582/portal/attachment/requirement/attachmentId/44488",
      "artifact_id": 262760
    }
  ]
}

Create Links Between Objects

POST /api/v3/projects/{projectId}/{objectType}/{objectId}/link?type={type}

qTest version: 7.6+

Description: to create links between objects

Path variable:

  • projectId: ID of the project
  • objectType: it can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects
  • objectId: Id of the source object to which you are adding the associated objects

Request Parameter:

Parameter Required Description
type yes It can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects. It is the object type of the associated objects which are being added to the source object

Request Body:

Request body includes an array which is a list of associated object ids separated by commas. Objects which are not the type specified in request parameter will not be added to the source object.

Request sample:

POST /api/v3/projects/5582/test-logs/2481734/link?type=defects HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json

[2145788, 2145790, 25086, 55121, 3321688, 3321684, 4318209,467126,467125, 3321700]

Response sample:

[
  {
    "id": 2481734,
    "objects": [
      {
        "id": 467126,
        "pid": "DFeCT-11",
        "link_type": "is_associated_with",
        "self": "http://nephele.qtestnet.com/api/v3/projects/5582/defects/467126"
      },
      {
        "id": 467125,
        "pid": "DFeCT-10",
        "link_type": "is_associated_with",
        "self": "http://nephele.qtestnet.com/api/v3/projects/5582/defects/467125"
      }
    ]
  }
]

Remove Links Between Objects

DELETE /api/v3/projects/{projectId}/{objectType}/{objectId}/link?type={type}

qTest version: 7.6+

Description: to remove links between objects

Path variable:

  • projectId: ID of the project
  • objectType: it can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects
  • objectId: Id of the source object from which you are removing the associated objects

Request Parameter:

Parameter Required Description
type yes It can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects. It is the object type of the associated objects which are being removed from the source object

Request Body:

Request body includes an array which is a list of associated object ids separated by commas

Request sample:

DELETE /api/v3/projects/5582/test-logs/2481734/link?type=defects HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json

[2145788, 2145790, 25086, 55121, 3321688, 3321684, 4318209,467126,467125, 3321700]

Query Comments

POST /api/v3/projects/{projectId}/comments

qTest version: 7.6+

Description: to query comments

Path variable:

  • projectId: ID of the project

Request body:

Attribute Name Required Type Description
object_type yes String Its value can be requirements, test-cases, test-runs, defects
object no String Id of the object from which you want to retrieve comments
authors no String Id of the user who made the comments
start no DateTime This value need to be in ISO Date format
end no DateTime This value need to be in ISO Date format

Request sample:

POST /api/v3/projects/5582/comments HTTP/1.1
Host: nephele.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json

{
    "object_type" : "requirements",
    "object" : "262760",
    "author" : "18476",
    "start" : "2016-05-15T00:00:00+00:00",
    "end" : "2016-05-22T00:00:00+00:00"
}

Response sample:

{
  "links": [],
  "page": 1,
  "page_size": 100,
  "total": 1,
  "items": [
    {
      "created": "2016-05-17T21:25:18+07:00",
      "userId": 18476,
      "links": [
        {
          "rel": "self",
          "href": "http://nephele.qtestnet.com/api/v3/projects/5582/requirements/262760/comments/387932"
        },
        {
          "rel": "requirement",
          "href": "http://nephele.qtestnet.com/api/v3/projects/5582/requirements/262760"
        }
      ],
      "id": 387932,
      "content": "This is the comment's content"
    }
  ]
}
Subscribe To Our Blog
Powered by Zendesk