mfa.get

Description

integer/array mfa.get(object parameters)

The method allows to retrieve MFA methods according to the given parameters.

This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
mfaids ID/array Return only MFA methods with the given IDs.
selectUsrgrps query Return a usrgrps property with user groups associated with MFA methods.

Supports count.
filter object Return only those results that exactly match the given filter.

Accepts an object, where the keys are property names, and the values are either a single value or an array of values to match against.

Supports properties:
mfaid - ID of the MFA method;
type - Type of the MFA method.
sortfield string/array Sort the result by the given properties.

Possible values: name.
search object Return results that match the given pattern (case-insensitive).

Accepts an object, where the keys are property names, and the values are strings to search for. If no additional options are given, this will perform a LIKE "%…%" search.

Supported properties: name.
countOutput boolean These parameters being common for all get methods are described in detail in the reference commentary page.
excludeSearch boolean
limit integer
output query
preservekeys boolean
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Return values

(integer/array) Returns either:

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

Examples

Finding MFA methods by name

Retrieve all MFA methods with "Zabbix" in their name.

Request:

{
           "jsonrpc": "2.0",
           "method": "mfa.get",
           "params": {
               "output": "extend",
               "search": {
                   "name": "Zabbix"
               }
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "mfaid": "1",
                   "type": "1",
                   "name": "Zabbix TOTP 1",
                   "hash_function": "1",
                   "code_length": "6",
                   "api_hostname": "",
                   "clientid": ""
               },
               {
                   "mfaid": "2",
                   "type": "1",
                   "name": "Zabbix TOTP 2",
                   "hash_function": "3",
                   "code_length": "8",
                   "api_hostname": "",
                   "clientid": ""
               }
           ],
           "id": 1
       }

Source

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