1. Go to this page and download the library: Download mifiel/api-client 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/ */
mifiel / api-client example snippets
use Mifiel\ApiClient as Mifiel;
Mifiel::setTokens('APP_ID', 'APP_SECRET');
// if you want to use our sandbox environment use:
Mifiel::url('https://sandbox.mifiel.com/api/v1/');
use Mifiel\Document;
$document = Document::find('id');
$document->original_hash;
$document->file;
$document->file_signed;
# ...
use Mifiel\Document;
$documents = Document::all();
use Mifiel\Document;
$document = new Document([
'file_path' => 'path/to/my-file.pdf',
'signatories' => [
[
'name' => 'Signer 1',
'email' => '[email protected]',
'tax_id' => 'AAA010101AAA'
],
[
'name' => 'Signer 2',
'email' => '[email protected]',
'tax_id' => 'AAA010102AAA'
]
]
]);
// if you dont want us to have the PDF, you can just send us
// the original_hash and the name of the document. Both are
use Mifiel\Document;
$document = Document::find('id');
# save the original file
$document->saveFile('path/to/save/file.pdf');
# save the signed file (original file + signatures page)
$document->saveFileSigned('path/to/save/file-signed.pdf');
# save the signed xml file
$document->saveXML('path/to/save/xml.xml');
use Mifiel\Document;
Document::delete('id');
use Mifiel\Certificate;
$sat_certificates = Certificate::sat();
use Mifiel\Certificate;
$certificate = Certificate::find('id');
$certificate->cer_hex;
$certificate->type_of;
# ...
use Mifiel\Certificate;
$certificates = Certificate::all();
use Mifiel\Certificate;
$certificate = new Certificate([
'file_path' => 'path/to/my-certificate.cer'
])
$certificate->save();
use Mifiel\Certificate;
Certificate::delete('id');
use Mifiel\Template;
$template = Template::find('id');
$template->name;
$template->header;
$template->content;
# ...
use Mifiel\Template;
$templates = Template::all();