PHP code example of np-digital / api

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

    

np-digital / api example snippets




use Symfony\Component\Dotenv\Dotenv;
use NPDigital\Api\Penneo;

$dotenv = new Dotenv();
$dotenv->load( $_SERVER['DOCUMENT_ROOT'] .'/.env');

$casefile = Penneo::casefile();
$folder = $casefile->getFolder('Temp');
$template = $casefile->getTemplate('Ansættelsesaftale');

$signers = [
	['name' => 'Wendy Willard', 'representing' => 'Self', 'email' => '[email protected]', 'signerTypeId' => 0],
	['name' => 'Sam Samson', 'representing' => 'Acme Inc', 'email' => '[email protected]', 'signerTypeId' => 1]
];
$documents = [
	['title' => 'StartPepple employment agreement', 'filename' => __DIR__.'/contract.pdf', 'documentTypeId' => 0],
	['title' => 'StartPepple Aps - general terms', 'filename' => __DIR__.'/terms.pdf', 'documentTypeId' => 1],
	['title' => 'StartPepple Aps - appendix', 'filename' => __DIR__.'/appendix.pdf', 'documentTypeId' => 2],
];

$response = $casefile->create(
	title: 'StartPeople employment contract ' . date('ymd-Hi'), 
	documents: $documents, 
	signers: $signers,
	template: $template,
	folder: $folder
)->send();

echo $response;

Penneo::casefile()->create(
	title: 'Start Pebble employment contract', 
	documents: $documents, 
	signers: $signers
)

$casefile = Penneo::casefile( casefileId: 447255 )->parse();
print_r($casefile->response);

Penneo::casefile( casefileId: 7466435 )->send();

$folder = $casefile->getFolder([$name | $id]);

$template = $casefile->getTemplate([$name | $id]);

$documents = Penneo::casefile( $casefileId )->getDocuments();

$documents = Penneo::casefile( $casefileId )->getSigners();

$folders = Penneo::casefile()->getFolders();
var_dump($folders);

$template_list = Penneo::casefile()->getTemplates();
var_dump($template_list);

$templateStructure = Penneo::casefile()->setTemplate($templateId)->showTemplate();
var_dump($templateStructure);