[comment]: # ({26c09afa-26c09afa})
# application.get

[comment]: # ({/26c09afa-26c09afa})

[comment]: # ({93a0de6c-93a0de6c})
### Description

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

The method allows to retrieve applications according to the given
parameters.

[comment]: # ({/93a0de6c-93a0de6c})

[comment]: # ({f9f00f02-f9f00f02})
### Parameters

`(object)` Parameters defining the desired output.

The method supports the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data_types)|Description|
|---------|---------------------------------------------------|-----------|
|applicationids|string/array|Return only applications with the given IDs.|
|groupids|string/array|Return only applications that belong to hosts from the given host groups.|
|hostids|string/array|Return only applications that belong to the given hosts.|
|inherited|boolean|If set to `true` return only applications inherited from a template.|
|itemids|string/array|Return only applications that contain the given items.|
|templated|boolean|If set to `true` return only applications that belong to templates.|
|templateids|string/array|Return only applications that belong to the given templates.|
|selectHost|query|Return the host that the application belongs to in the `host` property.|
|selectItems|query|Return the items contained in the application in the `items` property.|
|selectDiscoveryRule|query|Return the LLD rule that created the application in the `discoveryRule` property.|
|selectApplicationDiscovery|query|Return the application discovery object in the `applicationDiscovery` property.|
|sortfield|string/array|Sort the result by the given properties.<br><br>Possible values are: `applicationid` and `name`.|
|countOutput|boolean|These parameters being common for all `get` methods are described in detail in the [reference commentary](/manual/api/reference_commentary#common_get_method_parameters) page.|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

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

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

`(integer/array)` Returns either:

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

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

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

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

[comment]: # ({9b31f6ab-9b31f6ab})
#### Retrieving applications from a host

Retrieve all applications from a host sorted by name.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "application.get",
    "params": {
        "output": "extend",
        "hostids": "10001",
        "sortfield": "name"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": [
        {
            "applicationid": "13",
            "hostid": "10001",
            "name": "CPU",
            "templateids": []
        },
        {
            "applicationid": "5",
            "hostid": "10001",
            "name": "Filesystems",
            "templateids": []
        },
        {
            "applicationid": "21",
            "hostid": "10001",
            "name": "General",
            "templateids": []
        },
        {
            "applicationid": "15",
            "hostid": "10001",
            "name": "Memory",
            "templateids": []
        },
    ],
    "id": 1
}
```

[comment]: # ({/9b31f6ab-9b31f6ab})

[comment]: # ({1c57700e-1c57700e})
### See also

-   [Host](/manual/api/reference/host/object#host)
-   [Item](/manual/api/reference/item/object#item)

[comment]: # ({/1c57700e-1c57700e})

[comment]: # ({cb98f793-cb98f793})
### Source

CApplication::get() in
*frontends/php/include/classes/api/services/CApplication.php*.

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