Jump to content

Users equivalent of GetClientDetails?


prolateral

Recommended Posts

The GetUsers internal API call requires an email -- there is a GetClientDetails that allows us to retrieve info via the API for Client accounts given an id; but there doesn't seem to be any way to get access to a User's details without knowing the email.

We are trying usefully use the UserPasswordChanged hook - but it only provides a 'user_id' User ID -- and no possibility of working out what Client accounts that impacts...

Given a User 'user_id' -- how can we retrieve any more information via API?

Thanks in advance...

-Craig

Link to comment
Share on other sites

If you have the ID and are local, using the classes / Eloquent Models is better than API, IMO.  https://classdocs.whmcs.com/8.0/

An example of this would be: 
 

use WHMCS\User\Client;

$User = Client::find($user_id);

if ($Client)
{ 
    //Do your code
} 

That gets you the user, which could be a client or could be a user of a client and so using $Client->owner() might be needed. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated