Child pages
  • WHM API 1 Functions - twofactorauth_get_user_configs

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

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

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/twofactorauth_get_user_configs?api.version=1&user=example
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/twofactorauth_get_user_configs?api.version=1&user=example
Expand
titleCommand Line
Code Block
languagebash
whmapi1 twofactorauth_get_user_configs user=example

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{  
   "data":{  
      "example":{  
         "is_enabled":0,
         "primary_domain":"example.tld"
      }
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"twofactorauth_get_user_configs"
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<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>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

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
titleNote:

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