-
Notifications
You must be signed in to change notification settings - Fork 5
GetClientsDetails()
Through this explanation we assume that you have using WHMCS_API;
on the begining of the file
And the API()
class initialized as _api
If needed check the Getting Started page
Prototype: public GetClientsDetails.GetClientsDetails GetClientDetails(int ClientID = -1, string ClientEmail = "", bool Stats = false)
Input:
- ClientID: Filter Details for a specific Client ID (optional)
- ClientEmail: Filter Details for a specific Client Email (optional)
- Stats: Gets stats for the specified user (optional [default: false])
Input Note: ClientID or ClientEmail required
Output: GetClientsDetails
Model
Exception: "An API Error has Ocurred" witch contains an inner exception with further explanation of the error
To call it just use GetClientsDetails.GetClientsDetails clientDetails = _api.GetClientsDetails(1, Stats: true);
The GetClientDetails model is inside it's own namespace (more info)
The result will be stored in clientInfo variable with the result of the call (it should allways be success) with all the info of the client
View all details about GetClientsDetails Model
WHMCS API Reference: https://developers.whmcs.com/api-reference/getclientsdetails/
using WHMCS_API;
namespace YourApp
{
class YourClass
{
public void YourFunction()
{
API _api = new API("username", "password", "accesskey", "url");
try
{
GetClientsDetails.GetClientsDetails clientInfo = _api.GetClientsDetails(1);
Console.WriteLine("Firstname: {0} Email: {1}", clientInfo.Firstname, clientInfo.Email);
}
catch (Exception ex)
Console.WriteLine("API Error: {0}", ex.InnerException.Message);
}
}
}
PCDev Open Source Development Team 2017