-
Notifications
You must be signed in to change notification settings - Fork 5
GetClientsProducts()
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 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
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/
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);
}
}
}
}
PCDev Open Source Development Team 2017