yuramozol/com.docstudio.api.php-client

v110.4 2024-07-22 14:19 UTC

This package is auto-updated.

Last update: 2024-12-02 15:17:18 UTC


README

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: R110.5
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 7.4 and later

Installation & Usage

Composer

To install the bindings via Composer, do the following:

composer require jecksolovyev/com.docstudio.api.php-client

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
    require_once(__DIR__ . '/vendor/autoload.php');
    
    use DocStudio\Client\ApiException;
    use DocStudio\Client\Configuration;
    use DocStudio\Client\Model\LoginDTO;
    use DocStudio\Client\Model\QuickSendDTO;
    use DocStudio\Client\Model\QuickSendRecipientDTO;
    use DocStudio\Client\Api\EnvelopeControllerApi;
    use DocStudio\Client\Api\AuthenticationControllerApi;
    
    
    $httpClient = new GuzzleHttp\Client([
            'timeout' => 30,
            'connect_timeout' => 30,
            'read_timeout' => 30
        ]
    );
    
    $username = 'my@email.com';
    $password = 'password';
    
    $loginController = new AuthenticationControllerApi($httpClient);
    
    $token = $loginController->login((new LoginDTO())->setLogin($username)->setPassword($password))->getToken();
    
    echo 'Token: ' . $token . PHP_EOL;
    
    $configuration = new Configuration();
    $configuration->setUserAgent('Demo integration')->setAccessToken($token);
    
    $mailboxController = new DocStudio\Client\Api\MailboxControllerApi($httpClient, $configuration);
    $mailboxUuid = $mailboxController->getAllForUser()[0]->getMailboxUuid();
    $envelopeController = new EnvelopeControllerApi($httpClient, $configuration);
    
    $quickSendRequest = new QuickSendDTO();
    $quickSendRequest->setSubject('Test envelope')->setMessage('Test envelope message');
    $sender = new QuickSendRecipientDTO();
    $recipients = [];
    $sender->setRecipient($mailboxUuid)->setSigner(true)->setEInkSignature(true);
    $recipients[] = $sender;
    $recipient = new QuickSendRecipientDTO();
    $recipient->setRecipient('wife@family.com')->setSigner(true)->setEInkSignature(true);
    $recipients[] = $recipient;
    $quickSendRequest->setRecipients($recipients);

    $envelopeController->quickSendExternalDocuments(['/app/sample.pdf', '/app/sample2.pdf'], $quickSendRequest, $mailboxUuid);

API Endpoints

All URIs are relative to https://api.docstudio.com

Models