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

 

Description

This function checks for username conflicts during account restoration.

Examples


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


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)

Success:

{  
  "metadata":{  
      "version":1,
      "reason":"OK",
      "result":1,
      "command":"verify_new_username_for_restore"
   }
}

Failure:

{  
  "metadata":{  
      "version":1,
      "reason":"API failure: (XID fx6xw3) This system already has an account named “nick”.",
      "result":1,
      "command":"verify_new_username_for_restore"
   }
}
 Output (XML)

Success:

<result>
    <metadata>
        <version>1</version>
        <command>verify_new_username_for_restore</command>
        <reason>OK</reason>
        <result>1</result>
    </metadata>
</result>

Failure:

<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_for_restore</command>
        <version>1</version>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The account that you wish to transfer to the server.

A valid string.

username

 

Returns

This function only returns metadata.

Note:

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