HostFact API versie 3.1
Producten
Producten zijn te beheren via de controller 'product'.
list
Middels deze functie kunt u een lijst met producten ophalen. Zo kunt u bijvoorbeeld zoeken, waarbij u zelf meegeeft welke velden bekeken moeten worden, en filteren op een productgroep.
Voorbeeldbestand: /voorbeelden/product/product.list.php
Invoerparameters:
Veldnaam | Waarde | Omschrijving |
---|---|---|
offset | int | Standaard: 0 |
limit | int | Standaard: 1000 |
sort | string | Standaard: ProductCode |
order | 'ASC' of 'DESC' | Standaard: ASC |
searchat | string | Welke velden doorzocht moeten worden. Standaard: ProductCode|ProductName|ProductKeyPhrase |
searchfor | string | Zoekterm |
group | int | Filter op specifieke productgroep ID |
created | filter_datetime | Filtermogelijkheid op aanmaakdatum |
modified | filter_datetime | Filtermogelijkheid op wijzigingsdatum |
Voorbeeld invoer:
<?php require_once("../hostfact_api.php"); $api = new HostFactAPI(); $productParams = array( //'searchfor' => '' ); $response = $api->sendRequest('product', 'list', $productParams); print_r_pre($response); ?>
Voorbeeld uitvoer:
Array ( [controller] => product [action] => list [status] => success [date] => 2022-11-24T12:00:00+02:00 [totalresults] => 5 [currentresults] => 5 [offset] => 0 [products] => Array ( [0] => Array ( [Identifier] => 3 [ProductCode] => P001 [ProductName] => Default [ProductKeyPhrase] => Default product [ProductDescription] => [ProductType] => other [ProductTld] => [PackageID] => [NumberSuffix] => [PriceExcl] => 250 [TaxPercentage] => 21 [PricePeriod] => [Modified] => 2022-11-24 11:00:00 ) [1] => Array ( [Identifier] => 1 [ProductCode] => P002 [ProductName] => Hosting small [ProductKeyPhrase] => Hosting small [ProductDescription] => [ProductType] => hosting [ProductTld] => [PackageID] => 1 [NumberSuffix] => [PriceExcl] => 25 [TaxPercentage] => 21 [PricePeriod] => m [Modified] => 2022-11-24 11:00:00 ) [2] => Array ( [Identifier] => 2 [ProductCode] => P003 [ProductName] => Domain .com [ProductKeyPhrase] => Domain .com [ProductDescription] => [ProductType] => domain [ProductTld] => com [PackageID] => [NumberSuffix] => [PriceExcl] => 15 [TaxPercentage] => 21 [PricePeriod] => j [Modified] => 2022-11-24 11:00:00 ) [3] => Array ( [Identifier] => 4 [ProductCode] => P004 [ProductName] => SSL product [ProductKeyPhrase] => SSL certificate [ProductDescription] => [ProductType] => ssl [ProductTld] => [PackageID] => 1 [NumberSuffix] => [PriceExcl] => 50 [TaxPercentage] => 21 [PricePeriod] => j [Modified] => 2022-11-24 11:00:00 ) [4] => Array ( [Identifier] => 5 [ProductCode] => P005 [ProductName] => VPS package 1 [ProductKeyPhrase] => VPS package 1 [ProductDescription] => [ProductType] => vps [ProductTld] => [PackageID] => 1 [NumberSuffix] => [PriceExcl] => 35 [TaxPercentage] => 21 [PricePeriod] => m [Modified] => 2022-11-24 11:00:00 ) ) )