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

GetClientsProducts()

hitmanpt edited this page Feb 8, 2017 · 4 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 GetClientsProducts.GetClientsProducts GetClientsProducts(int LimitStart = 0, int LimitNum = 25, int ClientID = -1, int ServiceID = -1, int ProductID = -1, string Domain = "", string Username = "")

Input:

  • LimitStart: The offset for the returned log data (optional [default: 0])
  • LimitNumber: The number of records to return (optional [default: 25])
  • ClientID: The client id to obtain the details for (optional)
  • ServiceID: The specific service id to obtain the details for (optional)
  • ProductID: The specific product id to obtain the details for (optional)
  • Domain: The specific domain to obtain the service details for (optional)
  • Username: The specific username to obtain the details for (optional)

Output: GetClientsProducts Model


Function Details

To call it just use GetClientProducts.GetClientsProducts cp = _api.GetClientsProducts(ClientID: 1);

This call to the function will ignore all arguments except ClientID

The GetClientsProducts model is inside it's own namespace (more info)

View all details about GetClientsProducts Model

WHMCS API Reference: https://developers.whmcs.com/api-reference/getclientsproducts/

Donate


Full example

using WHMCS_API;

namespace YourApp
{
  class YourClass
  {
    public void YourFunction()
    {
       API _api = new API("username", "password", "accesskey", "url");
       GetClientsProducts.GetClientsProducts cp = _api.GetClientsProducts(ClientID: 1);      
       Console.WriteLine("This client has {0} products", cp.NumberReturned);
       foreach(GetClientsProducts.Product p in cp.Products.Product)
       {
         Console.WriteLine("Product name: {0}", p.Name);
       }
    }
  }
}