PUT/projects/{ProjectId}/configurations/{Id}

Applies to QAComplete 14.3, last modified on February 19, 2024

Updates the specified configuration.

Use the operation to replace the contents of an existing configuration with new contents in QAComplete.

To update individual fields of an existing configuration, use the …/configurations/{Id} (PATCH) operation.

To add a new configuration to your project, use the …/configurations (POST) operation.

Authentication

Basic authentication using a user’s login and password. See Authentication for details.

Security Rights

The authenticating user must belong to a security group that has the Update privilege for Test Library.

Request Format

To update the configuration, send a PUT request to the following URL:

http://{server}/rest-api/service/api/v2/projects/{ProjectId}/configurations/{Id}
URL parameters

ProjectId  :  integer, required

The ID of the project, to which the configuration belongs.

Id  :  integer, required

The ID of the configuration that you want to update.

Body parameters

In the request body, pass the RequestTestConfigurationPutV2 JSON object that describes the configuration’s new contents:

{
  "CustomFields": [
    {
      "Id": "string",
      "Name": "string",
      "Value": "string"
    }
  ],
  "FolderId": "int",
  "Title": "string",
  "Description": "string",
  "IsActive": "boolean",
  "OwnerUserId": "int",
  "OriginalId": "int",
  "ImportId": "int",
  "IsCBT": "boolean",
  "OperatingSystem": "string",
  "Browser": "string",
  "Resolution": "string"
}

Some string property values (for example, OperatingSystem) are based on the choice lists defined in your QAComplete project. To view these values, go to the Test Library > Configurations > Tools > Manage Choice Lists screen in QAComplete.

The property values you do not specify are set to their default values.

Title  :  string (max 255 chars), required

The title of the test configuration.

FolderId  :  integer

The ID of the folder to which the test configuration belongs.

Description  :  string

The test configuration description. Can include an HTML markup.

IsActive  :  boolean

Defines whether the test configuration is active or not.

OwnerUserId  :  integer

The ID of the user who owns the test configuration.

OriginalId  :  integer

For importing: The original key of the imported item to retain.

ImportId  :  integer

The ID of the operation that imported the test configuration from an external file to the Test Library. 0, if the test configuration was not imported.

IsCBT  :  boolean

Shows whether the test configuration should support the CrossBrowserTesting capabilities.

OperatingSystem  :  string

For CrossBrowserTesting configurations: The operation system associated with the configuration.

Browser  :  string

For CrossBrowserTesting configurations: The browser associated with the configuration.

Resolution  :  string

For CrossBrowserTesting configurations: The resolution associated with the configuration.

CustomFields  :  array of objects

An array of CustomFields objects that describe custom fields and their values:


{
  "Id": "string",
  "Name": "string",
  "Value": "string"
}

Id  :  string, required

The unique identifier of the custom field. Must be in the CustomN format, where N is the custom field’s number (index).

Name  :  string

The field name.

Value  :  string

The field value.

A sample request:

PUT http://yourserver.com/rest-api/service/api/v2/projects/11873/configurations/1 HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 243

{
  "Title": "Windows 10",
  "Description": "New CrossBrowserTesting-based Windows configuration",
  "IsCBT": "true",
  "OperatingSystem": "Windows 10",
  "Browser": "Chrome 66",
  "Resolution": "1920x1080"
}

A sample request made by using cURL:

curl -u [email protected]:p@ssword -d @configuration.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/service/api/v2/projects/11873/configurations/1

Response Format

On success, the operation responds with HTTP status code 200 and returns a JSON object with the updated configuration information.

A sample response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 602


{
        "id": 1,
        "folder_id": 0,
        "title": "Windows 10",
        "description": "New CrossBrowserTesting-based Windows configuration",
        "is_active": false,
        "create_user_id": 123456,
        "update_user_id": 123456,
        "date_created": "2016-08-31T09:13:59.9600000",
        "date_updated": "2016-08-31T09:13:59.9600000",
        "owner_user_id": 123456,
        "owner_name": "Smith, John ",
        "nbr_files_not_secured": 0,
        "user_name": "Smith, John ",
        "nbr_files": 0,
        "nbr_notes": 0,
        "original_id": 0,
        "import_id": 0,
        "project_id": 11873,
        "is_c_b_t": true,
        "operating_system": "Windows 10",
        "browser": "Chrome 66",
        "resolution": "Resolution",
        "custom_fields": [],
        "permissions": {
            "acl": 7
       }

Error responses

If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.

If the project with the specified ProjectId does not exist or the authenticating user does not have rights to access the project, the operation returns the Access is denied error.

If the configuration with the specified Id does not exist, the operation returns the File or directory not found error.

See Also

Configurations Resources

Highlight search results