Menu

Parameters APIs

If you are building an application or developing any integration that interacts with qTest Parameters, the Parameters API is the primary way to interact with qTest Parameters remotely. This article documents the API available in qTest Parameters along with sample requests and response codes.

Getting Started

1. From your browser, access to QASymphony API documentation site at https://api.qasymphony.com

2. From the top of the API home page, select qTest Parameters from Choose a product: field.

3. In Choose a version: field, select qTest Parameters v2.1.x

4. Click Explore 

access-to-parameters-api.png

You will be presented with the Parameters APIs documentation as shown below.

parameters-api.png

 

Authentication

To consume the Parameters APIs, first you need to login to qTest Manager using your qTest Manager credentials. Upon successfully logging in, you will receive an access token that will be used to authorize your access in subsequence API requests.

Login with username and password

You can use sample credentials listed in the API documentation page to login to qTest Manager:

  • Username: api-test@qasymphony.com
  • Password: admin123

credentials.png

Below example shows how you can login to qTest Manager via calling the login api.

1. API endpoint: https://parameters.qtestnet.com/oauth/v1/login

2. Method: POST

3. Content Type: application/json; charset=utf-8

4. Request Payload:

  {
    "qtest_url": "[YOUR_QTEST_MANAGER_SITE_URL]",
    "username": "[YOUR_QTEST_MANAGER_LOGIN_USER_NAME]",
    "password": "[YOUR_QTEST_MANAGER_LOGIN_PASSWORD]"
  }

5. Response codes:

  • 200: this response code indicates that you have successfully logged in to qTest Manager and has permission to access to qTest Parameters. You can obtain the access token in the response payload
  • 401: this response code indicates that you have failed to login to qTest Parameters. You should check whether the qtest_url is correct or your credentials are not mistyped or whether that credentials has permission to access to qTest Parameters.
  • 404: the qTest URL you entered was not found
  • 500: there is error at qTest Parameters server and you should contact QASymphony support

Try it out

1. Expand the /oauth/v1/login section then click on Try it out button

login-api-try-out-01.png

2.  Next, click on Execute button

login-api-try-out-02.png

3. The login API will be executed and you'll see a successful response with an access token on the response body, as shown in below screenshot.

login-api-try-out-03.png

Login with SSO token

If you are SSO users, you can use SSO token generated by qTest Manager to login to qTest Parameters. First, you need to access to qTest Manager and login with your SSO account, then obtain the SSO token in qTest Manager resources page to login to qTest Parameters.

Below example shows how you can login to qTest Manager via calling the login api.

1. API endpoint: https://parameters.qtestnet.com/oauth/v1/token-login

2. Method: POST

3. Content Type: application/json; charset=utf-8

4. Request Payload:

  {
    "qtest_url": "[YOUR_QTEST_MANAGER_SITE_URL]",
    "qtest_token": "[YOUR_SSO_TOKEN]"
  }

5. Response codes:

  • 200: this response code indicates that you have successfully logged in to qTest Manager and has permission to access to qTest Parameters. You can obtain the access token in the response payload
  • 401: this response code indicates that you have failed to login to qTest Parameters. You should check whether the qtest_url is correct or your credentials are not mistyped or whether that credentials has permission to access to qTest Parameters.
  • 404: the qTest URL you entered was not found
  • 500: there is error at qTest Parameters server and you should contact QASymphony support

Try it out

1. Expand the /oauth/v1/token-login section then click on Try it out button

token-login-tryout.png

2. Next, click on Execute button

token-login-execute.png

3. The login API will be executed and you'll see a successful response with an access token on the response body, as shown in below screenshot.

token-login-result.png

Authorization 

After successfully logging and obtaining the access token, you will need to put the access token into the HTTP request header of every other API requests.

Below is the information that you should put info the HTTP request header:

  • Key: x-access-token
  • Value: [access token]

Try it out

1.First, copy the access token in the response body of login request

2. On API documentation site, click on Authorize button.

authorize-01.png

2. From the Available authorizations dialog, paste the access token to the Value: field, then click Authorize.

authorize-02.png

Click x button to close Available authorizations dialog. Now you are ready to consume the Parameters APIs. 

Consuming the APIs

This section provides some examples that consume the Parameters APIs to access resources from qTest Parameters. 

Create a new Parameter

1. API endpoint: https://parameters.qtestnet.com/api/v1/parameters/create

2. Method: POST

3. Content Type: application/json; charset=utf-8

4. Request Payload:

  {
    "identifier": "[Name of the new parameter]",
    "description": "[Description of the new parameter]",
    "status": "[Status of the new parameter: Active | Inactive | Archived]",
    "project_ids": [an array of of qTest Manager project ids that the new parameter will be associated with, separated by a comma]
  }

Notes: the API documentation provides an ID of a sample project in qTest Manager, naming qConnect - Sample Project that you can use to try out the API. Also note that this sample project ID tends to change over time, so make sure you use the one listed in the API documentation page, not as the one listed in below screenshot.

sample-project-id.png

5. Response codes:

  • 201: the new parameter has been created successfully
  • 401: this response code indicates that you are not authorized to access this api
  • 500: there is error at qTest Parameters server and you should contact QASymphony support

Try it out

1. Expand the api/v1/parameters/create section then click on Try it out button

create-param-01.png

2. Next, enter request payload to Example Value field then click on Execute button:

  {
    "identifier": "Sample Parameter Name",
    "description": "Sample Parameter Description",
    "status": "Active",
    "project_ids": [66008]
  }

3. The create parameter api will be executed, and you will see a successful response that looks like below 

create-param-02.png

To verify the result, login to https://apitryout.qtestnet.com using credentials: 

  • Username: api-test@qasymphony.com
  • Password: admin123

then access to qTest Parameters from the 9-box icon. You will see the new parameter being created and displayed in the home page, as below screenshot.

create-param-03.png

 

Subscribe To Our Blog
Powered by Zendesk