cPanel API 2 Functions - Logaholic::fetchuser

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, the integrated Logaholic application 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

 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',
    )
);

 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',
    }
);

 cPanel Tag System (deprecated)

Warning:

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.

cPanel API 2 calls that use cPanel tags vary widely in code syntax and in their output. For more information, read our Deprecated cPanel Tag Usage documentation. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI.

 

 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 (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

Return

 Type

Description

 Possible values 

 Example 

 username 

 string 

 Required

 The Logaholic username. 

 A valid string.

 example

 

Returns

Return

Type

Description

Possible values

Example

 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

 integer

 The Logaholic user's ID number.

 A positive integer.

 3

 email

 string

 The Logaholic user's email address.

 A valid email address.

 user@example.com

 password

 string

 The Logaholic user's password, hidden for security reasons. 

 __HIDDEN__

 __HIDDEN__

 foreignkey

 string

 The Logaholic user's foreign key.

  

 

 metadata

 string

 The Logaholic user's metadata.

 

 

 lastlogin

 integer

 The Logaholic user's last login time, in Unix time format.

 A valid Unix timestamp.

 1413992677

 profiles

 string

 A list of the Logaholic user's profiles.

 A list of profile names.

 subdomain.example.com

 usersessionid

 string

 The Logaholic user's session ID.

 A valid session ID.

 cpsess1658535621

 accessAddProfile

 boolean

 Whether the Logaholic user may add profiles.

  • 1 — The Logaholic user may add profiles.
  • 0 — The Logaholic user may not add profiles.

 0

 name

 string

 The Logaholic user's name.

 A valid string.

 President Skroob

 active

 boolean

 Whether the Logaholic user is currently active.

  • 1 — Active.
  • 0 — Inactive.

 1

 subscriptionid

 string

 The Logaholic user's subscription number.

 An integer.

 0

 username

 string

 The Logaholic user's username.

 A valid string.

 example

 created

 integer

 The Logaholic user's creation time, in Unix time format.

 A valid Unix timestamp.

 1413992677

 accessEditProfile

 boolean

 Whether the Logaholic user may edit profiles.

  • 1 — May edit profiles.
  • 0 — May not edit profiles.

 1

 accessUpdateLogs 

 boolean

 Whether the Logaholic user may update logs.

  • 1 — May update logs.
  • 0 — May not update logs.

 0

 isAdmin

 boolean

 Whether the Logaholic user is an administrator.

  • 1 — Administrator.
  • 0 — Not an administrator.

 0

 expires

 boolean

 Whether the Logaholic user may expire.

  • 1 — May expire.
  • 0 — May not expire.

 0

 result

 boolean

  Whether the function succeeded.

  • 1 — Success.
  • 0 — Failure.

 1

 reason

 string

 A reason for failure.

 Note:

 This function only returns areasonvalue if it failed.

 A string that describes the error.

 This is an error message.

 result

 boolean 

 Whether the function succeeded.

  • 1 — Success.
  • 0 — Failure.

 1

  

  • 10 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....