<?php

include '../src/openkm/OpenKM.php';

use openkm\OKMWebServicesFactory;
use openkm\OpenKM;
use openkm\bean\Note;

class ExampleNode {

    const HOST = "http://localhost:8888/openkm/";
    const USER = "okmAdmin";
    const PASSWORD = "admin";

    private $ws;

    public function __construct() {
        $this->ws = OKMWebServicesFactory::build(self::HOST);
    }

    public function testGenerateDownloadToken() {
        echo '<pre>';
        try {
            $this->ws->login(self::USER, self::PASSWORD);
            $token = $this->ws->node->generateDownloadToken("d701c503-87fc-4a9e-829e-478dc375eb83", true);
            var_dump($token);
            echo 'token';
        } catch (Exception $e) {
            var_dump($e);
        }
    }
}

$openkm = new OpenKM(); //autoload
$exampleNode = new ExampleNode();
$exampleNode->testGenerateDownloadToken();
?>