HostFact API versie 3.1



Hosting

Hostingaccounts zijn te beheren via de controller 'hosting'.



edit

Met behulp van deze functie is het mogelijk om een hosting account te bewerken.
Alleen ingevoerde parameters worden gewijzigd.
Voorbeeldbestand: /voorbeelden/hosting/hosting.edit.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een hosting account
Username string De accountnaam (en gebruikersnaam)
Geef deze parameter niet mee wanneer de accountnaam automatisch bepaald mag worden.
Debtor int De unieke ID van een debiteur
DebtorCode string Het debiteurnummer
Domain string Domeinnaam
Password string Wachtwoord
ChangePasswordOnServer 'yes' of 'no' Wachtwoord wijzigen op de server? Standaard: 'no'
Server int De unieke ID van een server
Package int De unieke ID van een voorgedefinieerd hostingpakket
DirectCreation 'yes' of 'no' Direct aanmaken op de server? Standard 'no'
Comment string Commentaar
Status string Hostingaccount status, zie variabelen-lijst.
Standaard: 1 (wachten op actie)
HasSubscription 'yes' of 'no' Dienst factureren (abonnement)? Standaard; 'no'
Subscription array Abonnement:
- ProductCode string     Het productnummer
- Description text     Omschrijving
- PriceExcl float     Prijs per stuk (excl. BTW)
- TaxPercentage int     BTW percentage: 0 - 100
- DiscountPercentage float     Korting abonnement, percentage: 0 - 100
- Periods int     Factureer iedere: aantal periodes
- Periodic string     Factureer iedere: eenheid, zie variabelen-lijst
- StartPeriod date     Startdatum van de periode
- ContractPeriods int     Afwijkende contractperiode. Aantal van de
    frequentie eenheid 'ContractPeriodic'
- ContractPeriodic string     Afwijkende contractperiode. Frequentie eenheid,
    zie variabelen-lijst
- StartContract date     Startdatum afwijkende contractperiode
- EndContract date     Einddatum afwijkende contractperiode
- TerminationDate date     De datum waarop het abonnement opgezegd is
- Reminder 'yes', 'no' of ''     E-mail bij nieuwe facturatie van abonnement?
    Standaard: '' (Algemene instelling overnemen)
- InvoiceAuthorisation 'yes' of 'no'     Automatische incasso?
    Standaard: 'yes' = voorkeur debtor
Verplichte velden: Identifier of Username.
Bij facturatie (HasSubscription = yes): ProductCode of bij geen ProductCode zijn Description en PriceExcl verplicht

Voorbeeld invoer:
<?php

require_once("../hostfact_api.php");

$api = new HostFactAPI();

$hostingParams = array(
		'Username'		=> 'example',
		// Set hosting account to status active
		'Status'		=> 4
);

$response = $api->sendRequest('hosting', 'edit', $hostingParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => hosting
    [action] => edit
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [hosting] => Array
        (
            [Identifier] => 2
            [Username] => example
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Domain] => example.com
            [Server] => 1
            [Package] => 1
            [PackageName] => Hosting small
            [Comment] => 
            [Status] => 4
            [Created] => 2022-11-24 11:00:00
            [Modified] => 2022-11-24 11:00:00
            [Subscription] => Array
                (
                    [Number] => 1
                    [NumberSuffix] => 
                    [ProductCode] => P002
                    [Description] => Hosting small
                    [PriceExcl] => 25
                    [PriceIncl] => 30.25
                    [TaxPercentage] => 21
                    [DiscountPercentage] => 0
                    [Periods] => 1
                    [Periodic] => m
                    [StartPeriod] => 2018-03-14
                    [EndPeriod] => 2018-04-14
                    [NextDate] => 2018-02-28
                    [ContractPeriods] => 1
                    [ContractPeriodic] => m
                    [StartContract] => 2018-01-14
                    [EndContract] => 2018-08-14
                    [TerminationDate] => 
                    [Reminder] => 
                    [InvoiceAuthorisation] => yes
                    [AmountExcl] => 25
                    [AmountIncl] => 30.25
                )

            [PackageInfo] => Array
                (
                    [Identifier] => 1
                    [Name] => Hosting small
                    [Type] => normal
                    [Template] => yes
                    [TemplateName] => 
                    [BandWidth] => 
                    [DiscSpace] => 
                    [Domains] => 
                    [SubDomains] => 
                    [Domainpointers] => 
                    [MySQLDatabases] => 
                    [EmailAccounts] => 
                )

            [ServerInfo] => Array
                (
                    [Identifier] => 1
                    [Name] => Example server
                    [Panel] => hostingclass
                    [Location] => https://localhost
                    [Port] => 1234
                    [IP] => 
                    [AdditionalIP] => 
                    [Settings] => 
                    [DefaultDNSTemplate] => 1
                    [SSOSupport] => url
                )

            [Translations] => Array
                (
                    [Status] => Actief
                )

        )

)