NID – Porichoy API Integration

Share

To verify a NID (National Identification) & collected related data from the server through Porichoy API is described below.

First, you need to have an account at porichoy.gov.bd. Each account will have a secret key. Also, it gives 25 credits with this account for development/test purposes. Depending on the type of verification, that credit will consume on each verification. API documentation has been provided in the Account section.

Each type of verification has its own input & output pattern, which has been described in the documentation.   Here is a  code pattern of connecting  Autofill API to the system.

$postData = [];
$postData['nidNumber'] = $NID;
$postData['dateOfBirth'] = $DOB;
$postData['englishTranslation'] = true;

//---- API Endpoint -----
$url = 'https://api.porichoybd.com/api/v2/verifications/autofill';

$headers = [
'Content-Type:application/json',
'x-api-key:XXXXXXXXXXXXXXXXXXX'   //Secrate API Key
];

$postData = json_encode($postData);

$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);

$response = curl_exec($curl);
curl_close($curl);

$result = json_decode($response, true);

 

The sample API response for Autofill API is below.

$result = [
      'transactionId' => 'string',
      'creditCost' => 0,
      'creditCurrent' => 0,
      'status' => 'YES',
      'data' => [
            'nationalId' => [
                'fullNameEN' => 'BANGLADESH',
                'fathersNameEN' => 'XXXXXXXXX',
                'mothersNameEN' => 'XXXXXXXXX',
                'spouseNameEN' => 'XXXXXXXXX',
                'permenantAddressEN' => 'XXXXXXXXX',
                'fullNameBN' => 'বাংলাদেশ',
                'fathersNameBN' => 'XXXXXXXXX',
                'mothersNameBN' => 'XXXXXXXXX',
                'spouseNameBN' => '',
                'presentAddressBN' => 'XXXXXXXXX',
                'permanentAddressBN' => 'XXXXXXXXX',
                'gender' => 'female',
                'profession' => 'ছাত্র/ছাত্রী',
                'dateOfBirth' => '1970-01-01T00:00:00',
                'nationalIdNumber' => '1234567890',
                'photoUrl' => '',
            ],
     ],
     'errors' => [
            0 => [
                'code' => 'string',
                'message' => 'string',
            ],
     ],
];

 

Project Name: Shanta Securities Limited Client Portal

 

Leave a Reply

Related Articles

No related articles