Child pages
  • cPanel API 2 Functions - Logaholic::fetchuser
Skip to end of metadata
Go to start of metadata

 

Description

This function retrieves information about a Logaholic user.


Warning:

We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.


Important:

As of cPanel & WHM version 11.48, Logaholic is no longer available. We removed Logaholic's API functions, and they will not produce any results.

Examples 


 WHM API (JSON)
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Logaholic&cpanel_jsonapi_func=fetchuser&username=example


Note:

 For more information, read our Calls from the WHM API documentation.

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Fetch information about Logaholic user "example"
$fetch_logaholicuser = $cpanel->api2(
    'Logaholic', 'fetchuser', 
    array(
        'username'       => 'example', 
    ) 
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Fetch information about Logaholic user "example"
my $fetch_logaholicuser = $cpliveapi->api2(
    'Logaholic', 'fetchuser',
    { 
        'username'       => 'example', 
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)


Warnings:

  • In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI.
  • cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
  • For more information, read our Deprecated cPanel Tag Usage documentation.

 Command Line

Important:

Because we removed this function before we introduced this functionality, you cannot call this function via the command line. 

 Output (JSON)
{
  "cpanelresult": {
    "apiversion": 2,
    "func": "fetchuser",
    "data": [
      {
        "reason": "The Logaholic user \u201cexample\u201d exists.",
        "user": {
          "userid": "3",
          "email": "user@example.com",
          "password": "__HIDDEN__",
          "foreignkey": "",
          "metadata": "",
          "lastlogin": "1413992677",
          "profiles": "subdomain.example.com",
          "usersessionid": "cpsess1658535621",
          "accessAddProfile": "0",
          "name": "President Skroob",
          "active": "1",
          "subscriptionid": "0",
          "username": "example",
          "created": "1413992677",
          "accessEditProfile": "1",
          "accessUpdateLogs": "0",
          "isAdmin": "0",
          "expires": "0"
        },
        "result": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Logaholic"
  }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ReturnTypeDescriptionPossible valuesExample
usernamestring

Required

The Logaholic username.

A valid string.example

Returns

ReturnTypeDescriptionPossible valuesExample
reason string

The function's status.

  • The Logaholic user \u201cexample\u201d exists.
  • “example” does not own the user “user”.
The Logaholic user \u201cexample\u201d exists.
userid
integerThe Logaholic user's ID number.A positive integer.3
email
stringThe Logaholic user's email address.A valid email address.
user@example.com
password
stringThe Logaholic user's password, hidden for security reasons.
__HIDDEN__
__HIDDEN__
foreignkey
stringThe Logaholic user's foreign key.
  • A valid key.
  • A blank value.
""
metadata
stringThe Logaholic user's metadata.
  • A valid string.
  • A blank value.
""
lastlogin
integerThe Logaholic user's last login time, in Unix time format.A valid Unix timestamp.1413992677
profiles
stringA list of the Logaholic user's profiles.A list of profile names.
subdomain.example.com
usersessionid
stringThe Logaholic user's session ID.A valid session ID.cpsess1658535621
accessAddProfile
BooleanWhether the Logaholic user may add profiles.
  • 1 — The Logaholic user may add profiles.
  • 0 — The Logaholic user may not add profiles.
0
name
stringThe Logaholic user's name.A valid string.
President Skroob
active
BooleanWhether the Logaholic user is currently active.
  • 1 — Active.
  • 0 — Inactive.
1
subscriptionid
stringThe Logaholic user's subscription number.An integer.0
username
stringThe Logaholic user's username.A valid string.
example
created
integerThe Logaholic user's creation time, in Unix time format.A valid Unix timestamp.
1413992677
accessEditProfile
BooleanWhether the Logaholic user may edit profiles.
  • 1 — May edit profiles.
  • 0 — May not edit profiles.
1
accessUpdateLogs
BooleanWhether the Logaholic user may update logs.
  • 1 — May update logs.
  • 0 — May not update logs.
0
isAdmin
BooleanWhether the Logaholic user is an administrator.
  • 1 — Administrator.
  • 0 — Not an administrator.
0
expires
BooleanWhether the Logaholic user may expire.
  • 1 — May expire.
  • 0 — May not expire.
0
resultBoolean Whether the function succeeded.
  • 1 — Success.
  • 0 — Failure.
1
reasonstring

A reason for failure.

Note:

This function only returns a reason value if it failed.

A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — Success.
  • 0 — Failure.
1