Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

GetClientsDetails()

hitmanpt edited this page Feb 10, 2017 · 9 revisions

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

Contents


Function Overview

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


Function Details

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/

Donate


Full example

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