PHP code example of covie / sdk-php

1. Go to this page and download the library: Download covie/sdk-php 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/ */

    

covie / sdk-php example snippets


use Covie\SDK\Client;
$client = Client::createFromCredentials('client-id', 'client-secret');

$integration = $sdk->integrations()->create('test');

$key = $integration->getIntegrationKey();

$policy = $sdk->policies()->get($policyId);

echo json_encode($policy->jsonSerialize(), JSON_PRETTY_PRINT) . PHP_EOL;

use Covie\SDK\Model\DocumentType;
$pdfContent = $sdk->policies()->getLatestDocumentOfType($policy, DocumentType::DECLARATION);
file_put_contents('declaration.pdf', $pdfContent);
bash
$ composer