GET/hosts?name={HostName}&deptid={DeptID}

Applies to QAComplete 12.75 SaaS, last modified on April 01, 2021

Returns a test host by name.

You can use this operation to:

  • Check if a specific host is registered in QAComplete.

  • Get the host ID and security token by the host name. You need these values to authenticate other API operations with this host.

Authentication

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

Security Rights

The authenticating user must belong to a user group that has Read access to Test Hosts.

Request Format

To get a host by name, send a GET request to the following URL:

http://{server}/rest-api/service/automation/v2/hosts?name={HostName}&deptid={DeptID}

An asterisk (*) means a required parameter.

name  :  string, required

The computer name.

deptid  :  integer

The department ID where the host is registered. Use this parameter only if the authenticating user is added to multiple departments. To get a user’s departments, use /depts.

A sample request:

GET http://yourserver.com/rest-api/service/automation/v2/hosts?name={RACK11-W7X64} HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==

A sample request made by using cURL:

curl -u john@example.com:p@ssword http://yourserver.com/rest-api/service/automation/v2/hosts?name=RACK11-W7X64

Response Format

On success, the operation responds with HTTP status code 200 and returns a JSON object with the host ID, security token and other information.

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

A sample response:

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



{
  "id": 143,
  "host_name": "RACK11-W7X64",
  "host_configuration": "x64, net45, firefox, chrome, flash",
  "agents": [
    "TestComplete/TestExecute",
    "JUnit (Selenium)",
    "NUnit (Selenium)",
    "TestNG (Selenium)",
    "ReadyAPI / SoapUI OS"
  ],
  "os": "Windows 7 Ultimate 64-bit SP1",
  "is_active": true,
  "security_token": "d2e1ffd1-3c74-4ccf-738b-10997283e35f",
  "agent_version": "2.10.1607"
}

See Also

QAComplete Test Automation REST API Reference

Highlight search results