PHP code example of alexeevdv / sumsub-client

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

    

alexeevdv / sumsub-client example snippets


use alexeevdv\SumSub\Client;
use alexeevdv\SumSub\Request\RequestSigner;

$requestSigner = new RequestSigner('Your APP token', 'Your secret');

$client = new Client(
    $psr18HttpClient,
    $psr17HttpFactory,
    $requestSigner
);

use alexeevdv\SumSub\Request\AccessTokenRequest;

$externalUserId = 'some-id';
$levelName = 'some-level';
$ttlInSeconds = 3600;
$response = $client->getAccessToken(new AccessTokenRequest($externalUserId, $levelName, $ttlInSeconds));
$accessToken = $response->getToken();

use alexeevdv\SumSub\Request\ApplicantDataRequest;

$applicantId = 'some-id';
$response = $client->getApplicantData(new ApplicantDataRequest($applicantId));
$applicantData = $response->asArray();

use alexeevdv\SumSub\Request\ApplicantDataRequest;

$externalUserId = 'some-id';
$response = $client->getApplicantData(new ApplicantDataRequest(null, $externalUserId));
$applicantData = $response->asArray();

use alexeevdv\SumSub\Request\ResetApplicantRequest;

$applicantId = 'some-id';
$client->resetApplicant(new ResetApplicantRequest($applicantId));

use alexeevdv\SumSub\Request\ApplicantStatusRequest;

$applicantId = 'some-id';
$response = $client->getApplicantStatus(new ApplicantStatusRequest($applicantId));
$applicantStatus = $response->asArray();

use alexeevdv\SumSub\Request\DocumentImageRequest;

$inspectionId = 'some-id';
$imageId = '123';
$response = $client->getDocumentImages(new DocumentImageRequest($inspectionId, $imageId));
$stream = $response->asStream();
$conentType = $response->getContentType();

use alexeevdv\SumSub\Request\InspectionChecksRequest;

$inspectionId = 'some-id';
$response = $client->getInspectionChecks(new InspectionChecksRequest($inspectionId));
$checksData = $response->asArray();