uicosss/aits_person_lookup_confidential

AITS Person Lookup Confidential API 的 PHP 包装器 API

v1.2.0 2024-03-21 17:24 UTC

This package is auto-updated.

Last update: 2024-09-21 18:31:39 UTC


README

AITS - Person Lookup Confidential

用于使用 AITS Person Lookup Confidential API 的 PHP 库。请联系 AITS 获取更多实现细节。

用法

要使用此库,您需要

在您的程序中包含库

require_once 'AitsPersonLookupConfidential.php';

或使用 composer

composer require uicosss/aits_person_lookup_confidential
require_once 'vendor/autoload.php';

创建类的对象实例

$apiUrl = 'apiurl.com/without/trailing/slash'; // Contact AITS for this
$subscriptionKey = 'YOUR_SUBSCRIPTION_KEY'; // Contact AITS for this
$personApi = new uicosss\AitsPersonLookupConfidential($apiUrl, $subscriptionKey);

从 API 调用获取结果

默认响应将是 JSON,但您也可以请求原始数据,这将是一个 StdClass 对象。请联系 AITS 获取 API 架构的更多详细信息。

$lookupKey = 'sparky'; // NetID or UIN
$personApi->findPerson($lookupKey); // Conduct the person lookup
echo $personApi->getResponse(true); // See raw JSON response
$json = $personApi->getResponse(); // Get decoded JSON array

示例

您可以使用附带的 examples/cli-test.php 文件从命令行测试功能。

php cli-test.php apiurl.com/without/trailing/slash YOUR_SUBSCRIPTION_KEY lookupkey