Child pages
  • WHM API 1 Functions - twofactorauth_remove_user_config

Versions Compared

Key

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

 

Description

Excerpt

This function removes the Two-Factor Authentication (2FA) settings for one or more specified user accounts.

Note
titleNote:

If you remove the 2FA settings for an account, the user must perform the setup procedure again to re-configure 2FA on the account.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


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

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{  
   "data":{  
      "users_modified":[  
         "example"
      ],
      "failed":{  

      }
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"twofactorauth_remove_user_config"
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<result>
    <data>
        <users_modified>example</users_modified>
        <failed/>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>twofactorauth_remove_user_config</command>
    </metadata>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The account's username.

Note
titleNote:

To remove multiple users, increment the parameter name. For example, user-1user-2, or user-3.

A valid string.example

Returns

Return

TypeDescriptionPossible valuesExample

users_modified

array

An array of the user accounts for which you successfully removed 2FA settings.

 

A valid array of cPanel account names.

example

failed

hash

A hash of the user accounts for which removal failed.

 

This hash includes the username return.

 

username*

string

The reason for the failure.

Note
titleNote:

The user's name is the return name.

The function returns this value in the failed hash.

A valid string.You are not authorized to modify “example”