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 the QASymphony API documentation site at https://api.qasymphony.com.

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

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

4. Click Explore.

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

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 subsequent 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

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 qTestParameters. You can obtain the access token in the response payload.

    • 401: This response code indicates that you have failed to login to qTestParameters. 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 qTestParameters server and you should contact QASymphony support.

Try it out

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

  2. Click the Execute button.

  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 the following screenshot.

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.

The following 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 qTestParameters. You can obtain the access token in the response payload.

    • 401: This response code indicates that you have failed to login to qTestParameters. 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 qTestParameters server and you should contact QASymphony support.

Try it out

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

  2. Click the Execute button.

  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 the following screenshot.

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. Copy the access token in the response body of login request.

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

  3. On the Available authorizations dialog, paste the access token in the Value field.

  4. Click Authorize.

  5. Click the x button to close the 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]   }

    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 the following screenshot.

  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 qTestParameters server and you should contact QASymphony support.

Try it out

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

  2. Enter request payload in the Example Value field. Then click the 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 the following screenshot.

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

  • Username: api-test@qasymphony.com

  • Password: admin123

Then access qTest Parameters from the 9-box icon. You will see the new parameter displayed in the home page, as in the following screenshot.