[comment]: # ({7f8cd3a3-7f8cd3a3})
# httptest.get

[comment]: # ({/7f8cd3a3-7f8cd3a3})

[comment]: # ({70e0f3e6-96cbc36d})
### Description

`integer/array httptest.get(object parameters)`

The method allows to retrieve web scenarios according to the given parameters.

::: noteclassic
This method is available to users of any type.
Permissions to call the method can be revoked in user role settings.
See [User roles](/manual/web_interface/frontend_sections/users/user_roles) for more information.
:::

[comment]: # ({/70e0f3e6-96cbc36d})

[comment]: # ({6422f5ac-7be2c19f})
### Parameters

`(object)` Parameters defining the desired output.

The method supports the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|groupids|ID/array|Return only web scenarios that belong to the given host groups.|
|hostids|ID/array|Return only web scenarios that belong to the given hosts.|
|httptestids|ID/array|Return only web scenarios with the given IDs.|
|inherited|boolean|If set to `true`, return only web scenarios inherited from a template.|
|monitored|boolean|If set to `true`, return only enabled web scenarios that belong to monitored hosts.|
|templated|boolean|If set to `true`, return only web scenarios that belong to templates.|
|templateids|ID/array|Return only web scenarios that belong to the given templates.|
|expandName|flag|Expand macros in the name of the web scenario.|
|expandStepName|flag|Expand macros in the names of scenario steps.|
|evaltype|integer|Tag [evaluation method](/manual/web_interface/frontend_sections/data_collection/web#using-filter).<br><br>Possible values:<br>0 - *(default)* And/Or;<br>2 - Or.|
|tags|array|Return only web scenarios with the given tags.<br>Format: `[{"tag": "<tag>", "value": "<value>", "operator": "<operator>"}, ...]`.<br>An empty array returns all web scenarios.<br><br>Possible [operator](/manual/web_interface/frontend_sections/data_collection/web#using-filter) values:<br>0 - *(default)* Contains;<br>1 - Equals;<br>2 - Does not contain;<br>3 - Does not equal;<br>4 - Exists;<br>5 - Does not exist.|
|selectHosts|query|Return the hosts that the web scenario belongs to as an array in the [`hosts`](/manual/api/reference/host/object) property.|
|selectSteps|query|Return web scenario steps in the [`steps`](/manual/api/reference/httptest/object#scenario-step) property.<br><br>Supports `count`.|
|selectTags|query|Return web scenario tags in the [`tags`](/manual/api/reference/httptest/object#web-scenario-tag) property.|
|sortfield|string/array|Sort the result by the given properties.<br><br>Possible values: `httptestid`, `name`.|
|countOutput|boolean|These parameters are described in the [reference commentary](/manual/api/reference_commentary#common-get-method-parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/6422f5ac-7be2c19f})

[comment]: # ({07ca11ca-7223bab1})
### Return values

`(integer/array)` Returns either:

-   an array of objects;
-   the count of retrieved objects, if the `countOutput` parameter has been used.

[comment]: # ({/07ca11ca-7223bab1})

[comment]: # ({b41637d2-b41637d2})
### Examples

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({300b343b-c93618d6})
#### Retrieving a web scenario

Retrieve all data about web scenario "9".

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "httptest.get",
    "params": {
        "output": "extend",
        "selectSteps": "extend",
        "httptestids": "9"
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "httptestid": "9",
            "name": "Homepage check",
            "delay": "1m",
            "status": "0",
            "variables": [],
            "agent": "Zabbix",
            "authentication": "0",
            "http_user": "",
            "http_password": "",
            "hostid": "10084",
            "templateid": "0",
            "http_proxy": "",
            "retries": "1",
            "ssl_cert_file": "",
            "ssl_key_file": "",
            "ssl_key_password": "",
            "verify_peer": "0",
            "verify_host": "0",
            "headers": [],
            "steps": [
                {
                    "httpstepid": "36",
                    "httptestid": "9",
                    "name": "Homepage",
                    "no": "1",
                    "url": "http://example.com",
                    "timeout": "15s",
                    "posts": "",
                    "required": "",
                    "status_codes": "200",
                    "variables": [
                        {
                            "name":"{var}",
                            "value":"12"
                        }
                    ],
                    "follow_redirects": "1",
                    "retrieve_mode": "0",
                    "headers": [],
                    "query_fields": []
                },
                {
                    "httpstepid": "37",
                    "httptestid": "9",
                    "name": "Homepage / About",
                    "no": "2",
                    "url": "http://example.com/about",
                    "timeout": "15s",
                    "posts": "",
                    "required": "",
                    "status_codes": "200",
                    "variables": [],
                    "follow_redirects": "1",
                    "retrieve_mode": "0",
                    "headers": [],
                    "query_fields": []
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/300b343b-c93618d6})

[comment]: # ({2906645b-ce685d69})
### See also

-   [Host](/manual/api/reference/host/object#host)
-   [Scenario step](object#scenario-step)

[comment]: # ({/2906645b-ce685d69})

[comment]: # ({8ec619ff-8ec619ff})
### Source

CHttpTest::get() in *ui/include/classes/api/services/CHttpTest.php*.

[comment]: # ({/8ec619ff-8ec619ff})
