Fingerprint Pro Server PHP SDK i

composer require fingerprint/fingerprint-pro-server-api-sdk

P:1be3by3hxGNtEbt16ukm

S:EWokKBV0uXwmAvcRyGLU

The Fingerprint Pro Server PHP SDK is an easy way to interact with our Server API from your PHP application. You can retrieve visitor history or individual identification events.

How to install

Add the package to your composer.json file as a dependency:

composer require fingerprint/fingerprint-pro-server-api-sdk

Initialize the client instance and use it to make API requests. The code snippet below already includes your secret API key and region.

<?php

require_once(__DIR__ . '/vendor/autoload.php');
use Fingerprint\ServerAPI\Api\FingerprintApi;
use Fingerprint\ServerAPI\Configuration;
use GuzzleHttp\Client;

$config = Configuration::getDefaultConfiguration(
  "EWokKBV0uXwmAvcRyGLU",
  Configuration::REGION_ASIA
);
$client = new FingerprintApi(
  new Client(),
  $config
);

// Get visit history of a specific visitor
try {
  $response = $client->getVisits("<visitorId>");
  echo "<pre>" . $response->__toString() . "</pre>";
} catch (Exception $e) {
  echo $e->getMessage(), PHP_EOL;
}

// Get a specific identification event
try {
  $response = $client->getEvent("<requestId>");
  echo "<pre>" . $response->__toString() . "</pre>";
} catch (Exception $e) {
  echo $e->getMessage(), PHP_EOL;
}

Go to the SDK’s GitHub repository or read our documentation for more information.


已发布

分类

来自

标签:

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注