GBG Id scan Api в php

#php #codeigniter

#php #codeigniter — инициализатор кода

Вопрос:

Мне нужно реализовать GBG id scan api для распознавания проверки загруженных документов, удостоверяющих личность. Я попробовал сделать следующее. Платформа — php codeigniter.

     $img_path = base_url()."images/NID-1.jpg";
    $img_content = file_get_contents($img_path);
    $encode_img = base64_encode($img_content);

    $img_path2 = base_url()."images/NID-2.jpg";
    $img_content2 = file_get_contents($img_path2);
    $encode_img2 = base64_encode($img_content2);

    $ids_user_name = "XXXXXXXXXX";
    $ids_passwd = "XXXXXXXXXXX";


    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://poc.idscan.cloud/idscanenterprisesvc/token',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => 'username='.$ids_user_name.'amp;password='.$ids_passwd.'amp;grant_type=passwordamp;area=scanning',
    CURLOPT_HTTPHEADER => array(
        'Content-Type: application/x-www-form-urlencoded'
        ),
    ));

    $response = curl_exec($curl);

    curl_close($curl);
    
    $decode_response = json_decode($response);

    $access_token = $decode_response->access_token;

    $token_type = $decode_response->token_type;

    
    $curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://poc.idscan.cloud/idscanenterprisesvc/journey/upload',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>"{'InputImages': [{'Name':'WhiteImage','ImageFormat':'jpg','Data':'".$encode_img."'}],'IsDocumentExtracted':'false','Source':2}",
    CURLOPT_HTTPHEADER => array(
            'Authorization: Bearer '.$access_token,
            'Content-Type: application/json'
        ),
    ));

    $response1 = curl_exec($curl);

    curl_close($curl);
    $decode_response1 = json_decode($response1);


    echo '<pre>';
    print_r($decode_response1);
    exit;


    Response:

    stdClass Object
   (
       [PersonEntryId] => 00000000-0000-0000-0000-000000000000
       [EntryDateTime] => 0001-01-01T00:00:00
       [CurrentResult] => ProcessingError
       [IsFinished] =>
       [RequestId] => 00000000-0000-0000-0000-000000000000
       [HasError] => 
       [EntryData] => stdClass Object(
                      )
   )
 

пожалуйста, помогите мне решить эту ошибку обработки

я сослался на этот документ https://docs.idscan.com/docs/ieos-web-api-8-7/actions/upload /

Мне нужно загрузить документ, удостоверяющий личность, в серверную часть IDscan для обработки вместе с дополнительными входными данными для сопоставления лиц, чтобы сопоставить два лица.

Заранее спасибо..

Комментарии:

1. Проверьте свои файлы журналов IDscan.

2. Я уже проверил, но в файле журнала нет решения..