PHP code example of ung / sign-client

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

    

ung / sign-client example snippets




use SignClient\Config;
use SignClient\SignRequest;

Config::$isProduction = false;
Config::$clientKey = "client";
Config::$secretKey = "secret";

try {
    $params = array(
        'client_id'       => 'client_app',
        'document_id'     => 'uuid', // Dokumen ID (* disarankan UUID)
        'category'        => 'ijazah , transkrip, sertifikat, surat',
        'title'           => 'judul dokumen', // Judul Dokumen
        'assign_to'       => ['7571*****', '7572*****'], // NIK Penandatangan (* Dalam Array, Isikan Siapa saja yang akan TTE
        'document_url'    => 'https://www.africau.edu/images/default/sample.pdf', // URL File Dokumen (* Wajib Https)
        'document_status' => ['1', '2'], // Status Dokumen Yang dikirim (* Jumlah Statusnya dalam array
        'sign_symbol'     => ['#', '@'], // Simbol untuk untuk koordinat lokasi tanda tangan (ex. *,@,#,|,^,$)
        'sign_category'   => ['visible', 'invisible'], // Kategori Tanda tangan (* Visible atau Invisible
        'page_visualize'   => ['1', '2'], // Lokasi Halaman Berapa untuk visualisasi TTE (* Jika Visible
        'sign_reason'     => ['Paraf Dekan secara Elektronik', 'Tanda Tangan secara Elektronik'], // Alasan Penandatanganan
        'sign_type'       => ['image', 'image'], // Wajib isi jika category "visible"
        'sign_image'      => ['', 'https://www.africau.edu/images/default/sample.png'], // url image TTE jika type image
        'sign_width'      => ['10', '20'], // ukuran lebar qrcode/image dalam pixel
        'sign_height'     => ['10', '10'], // ukuran tinggi qrcode/image dalam pixel
    );

    $request = SignRequest::create($params);
    echo $request->message;
} catch (\Exception $e) {
    echo $e->getMessage();
}







use SignClient\Config;
use SignClient\SignResponse;

Config::$isProduction = false;
Config::$clientKey = "client";
Config::$secretKey = "secret";

try {
    $response = new SignResponse->getResponse();
}
catch (\Exception $e) {
    echo $e->getMessage();
}