PHP code example of glsv / diadoc-api

1. Go to this page and download the library: Download glsv/diadoc-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

glsv / diadoc-api example snippets


// Сервис аутентификации
$authenticator = new PasswordAuthenticator($login, $passwd);

// API с передачей в него настрок и зависимостей
$api = new DiadocClientApi($baseUrl, $developer_key, $authenticator);

// Сформировать запрос на конкретную функцию. 
// Инициализация всех обязательных свойств запроса производится через конструктор
$request = new GetDocumentRequest($boxId, $messageId, $entityId);

// Создать объект команды с передачей API и созданного запроса
$command = new GetDocumentCommand($api, $request);

// Выполнить команду
$result = $command->execute();