Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function regenerates or retrieves a user's access hash.

Warning:

We deprecated this function in cPanel & WHM version 64. We strongly suggest that you use the WHM API 1 api_token_create function.

Examples 


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

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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "data": {
    "accesshash": "cb523f89e9a31123fde7c6f93b580ac05bf00a2804d4febe6667ab9917
a14baa1c4914da209bf55c862999ea51983a117a4d2f238140200b1e5b270b94b2c5249
2747e5ebfdeddb8abf4e1b0c428c6c68b701b48e13dbe39da49450e7a8e5422e18ab3b6
290b5b6556bd82ee21d9c1103e7a51d1e94f2ac0c4dcc6a10954b8634c6db16a541660
c3c89e10254f05583f4167adfcff7781090ea930647b46e5b981f3e16c7723ca4e12dc4b
54a778dc66a28df73632a0d3a8e01e207b9fd6b555b72936a903af014f30061d712d7361
76a87fb5333c5b90cf0bb4f3c6735f2b45929ac79fb1184045a5f4c20bfcc553f5ab760ee
c077c0d6096e54d02724201281e441e7b0f642370a63f61c68766e224c8510bc32b0316
780660c34352cbfeeccfee9d4f02e20ba7b664d3e84e9419ca386c41df07613f8af252ab
a8626a8b54796bbe616f41af1e6f11a3d0327f7608d23666fca64e6ebe899f7479a5fb0ae
a008b1e7a41890c9c58037682450febf91b7aa1c080d31d834b0ae466f8533df838ab27
1b26a7fb7de96402ad4a818d6b786af92c38414d2ef6c88deb7c685a1e60c3cbcfbf20cf6
d2a00dd50d2be9bc1824d91284ec6842dd7db42564dfc3ecb75c1a9bc775c45c5f087
84b9e2885c2d"
  },
  "metadata": {
    "command": "accesshash",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}
 Output (XML)
<result>
    <data>
        <accesshash>
            cb523f89e9a31123fde7c6f93b580ac05bf00a2804d4febe6667ab9917
a14baa1c4914da209bf55c862999ea51983a117a4d2f238140200b1e5b270b94b2c5249
2747e5ebfdeddb8abf4e1b0c428c6c68b701b48e13dbe39da49450e7a8e5422e18ab3b6
290b5b6556bd82ee21d9c1103e7a51d1e94f2ac0c4dcc6a10954b8634c6db16a541660
c3c89e10254f05583f4167adfcff7781090ea930647b46e5b981f3e16c7723ca4e12dc4b
54a778dc66a28df73632a0d3a8e01e207b9fd6b555b72936a903af014f30061d712d7361
76a87fb5333c5b90cf0bb4f3c6735f2b45929ac79fb1184045a5f4c20bfcc553f5ab760ee
c077c0d6096e54d02724201281e441e7b0f642370a63f61c68766e224c8510bc32b0316
780660c34352cbfeeccfee9d4f02e20ba7b664d3e84e9419ca386c41df07613f8af252ab
a8626a8b54796bbe616f41af1e6f11a3d0327f7608d23666fca64e6ebe899f7479a5fb0ae
a008b1e7a41890c9c58037682450febf91b7aa1c080d31d834b0ae466f8533df838ab27
1b26a7fb7de96402ad4a818d6b786af92c38414d2ef6c88deb7c685a1e60c3cbcfbf20cf6
d2a00dd50d2be9bc1824d91284ec6842dd7db42564dfc3ecb75c1a9bc775c45c5f087
84b9e2885c2d
                  </accesshash>
        </data>
        <metadata>
            <result>1</result>
            <reason>OK</reason>
            <version>1</version>
            <command>accesshash</command>
        </metadata>
    </result>

Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The user's name.

A valid cPanel username.
root
generateBoolean

Required

Whether to regenerate the access hash.

  • 1 — Regenerate the access hash.
  • 0 — Do not regenerate the access hash.
0

Returns

ParameterTypeDescriptionPossible valuesExample
accesshashstringThe user's access hash.A valid string.
 Click to view...
cb523f89e9a31123fde7c6f93b580ac05bf00a2804d4febe6667ab9917
a14baa1c4914da209bf55c862999ea51983a117a4d2f238140200b1e5b270b94b2c5249
2747e5ebfdeddb8abf4e1b0c428c6c68b701b48e13dbe39da49450e7a8e5422e18ab3b6
290b5b6556bd82ee21d9c1103e7a51d1e94f2ac0c4dcc6a10954b8634c6db16a541660
c3c89e10254f05583f4167adfcff7781090ea930647b46e5b981f3e16c7723ca4e12dc4b
54a778dc66a28df73632a0d3a8e01e207b9fd6b555b72936a903af014f30061d712d7361
76a87fb5333c5b90cf0bb4f3c6735f2b45929ac79fb1184045a5f4c20bfcc553f5ab760ee
c077c0d6096e54d02724201281e441e7b0f642370a63f61c68766e224c8510bc32b0316
780660c34352cbfeeccfee9d4f02e20ba7b664d3e84e9419ca386c41df07613f8af252ab
a8626a8b54796bbe616f41af1e6f11a3d0327f7608d23666fca64e6ebe899f7479a5fb0ae
a008b1e7a41890c9c58037682450febf91b7aa1c080d31d834b0ae466f8533df838ab27
1b26a7fb7de96402ad4a818d6b786af92c38414d2ef6c88deb7c685a1e60c3cbcfbf20cf6
d2a00dd50d2be9bc1824d91284ec6842dd7db42564dfc3ecb75c1a9bc775c45c5f087
84b9e2885c2d