Child pages
  • WHM API 1 Functions - twofactorauth_get_user_configs
Skip to end of metadata
Go to start of metadata

 

Description

This function returns a list of user-controlled accounts and whether the accounts have Two-Factor Authentication (2FA) enabled.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/twofactorauth_get_user_configs?api.version=1&user=example
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/twofactorauth_get_user_configs?api.version=1&user=example
 Command Line
whmapi1 twofactorauth_get_user_configs user=example


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "data":{  
      "example":{  
         "is_enabled":0,
         "primary_domain":"example.tld"
      }
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"twofactorauth_get_user_configs"
   }
}
 Output (XML)
<result>
    <data>
        <example>
            <is_enabled>0</is_enabled>
            <primary_domain>example.tld</primary_domain>
        </example>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>twofactorauth_get_user_configs</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterType

Description

Possible valuesExample
userstring

The username for a specified account.

If you do not specify a value, the function returns all user accounts.

A valid string.example

Returns

Return

TypeDescriptionPossible valuesExample

account_name

hash

A hash of the account's data.

Note:

The account's name is the return name.

This hash includes the is_enabled and primary_domain returns.

 

is_enabled

Boolean

Whether the account has 2FA enabled.

The function returns this value in the account_name hash.

  • 1 — Enabled.
  • 0Not enabled.
1

primary_domain

string

The account's primary domain.

The function returns this value in the account_name hash.

A valid string.

example.tld