Page tree

Versions Compared

Key

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

 

Description

Excerpt

This function checks for username conflicts during account creation.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


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

Include Page
_WHMAPI1CLINote
_WHMAPI1CLINote

Expand
titleOutput (JSON)

Success:

Code Block
languagetext
linenumberstrue
{  
  "metadata":{  
      "version":1,
      "reason":"OK",
      "result":1,
      "command":"verify_new_username"
   }
}

Failure:

Code Block
languagetext
linenumberstrue
{  
  "metadata":{  
      "version":1,
      "reason":"API failure: (XID fx6xw3) This system already has an account named “nick”.",
      "result":1,
      "command":"verify_new_username"
   }
}
Expand
titleOutput (XML)

Success:

Code Block
languagetext
linenumberstrue
<result>
    <metadata>
        <version>1</version>
        <command>verify_new_username</command>
        <reason>OK</reason>
        <result>1</result>
    </metadata>
</result>

Failure:

Code Block
languagetext
linenumberstrue
<result>
    <metadata>
        <reason>
            API failure: (XID fx6xw3) This system already has an account named &#x201C;nick&#x201D;.
        </reason>
        <result>0</result>
        <command>verify_new_username</command>
        <version>1</version>
    </metadata>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The account that you wish to create.

A valid string.

username

 

Returns

This function only returns metadata.

Note
titleNote:

If the function detects a username conflict, it outputs an error message in the reason return.