HostFact API versie 3.1



Crediteuren

Crediteuren zijn te beheren via de controller 'creditor'.



attachment download

Middels deze functie kunt u een bijlagen van een crediteur downloaden. Het bestand wordt in een Base64 encoded string teruggegeven.
Voorbeeldbestand: /voorbeelden/attachment/attachment.creditor.download.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een bijlagen
ReferenceIdentifier int De unieke ID van een crediteur
CreditorCode string Het crediteurnummer
Type string Bij crediteur altijd 'creditor'
Filename string De bestandsnaam
Verplichte velden: Identifier of Filename, ReferenceIdentifier of CreditorCode en Type

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$attachmentParams = array(
				'CreditorCode'	=> 'CD0001',
				'Type'			=> 'creditor',
				'Filename'		=> 'sample.pdf'
);

$response = $api->sendRequest('attachment', 'download', $attachmentParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => attachment
    [action] => download
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [success] => Array
        (
            [0] => sample.pdf
            [1] => JVBERi0xLj...olJUVPRg==
        )

)