Vault
Table of Contents
- $apiendpoint : mixed
- $apikey : mixed
- $throwError : mixed
- __construct() : void
- Initialize Vault API with an API key, and optional region (US, EU)
- addImage() : array<string|int, mixed>
- Add a document or face image into an existing vault entry
- delete() : bool
- Delete a single or multiple vault entries
- deleteImage() : bool
- Delete an image from vault
- get() : array<string|int, mixed>
- Get a single vault entry
- list() : array<string|int, mixed>
- List multiple vault entries with optional filter, sorting and paging arguments
- searchFace() : array<string|int, mixed>
- Search vault using a person's face image
- throwAPIException() : void
- Whether an exception should be thrown if API response contains an error message
- trainFace() : array<string|int, mixed>
- Train vault for face search
- trainingStatus() : array<string|int, mixed>
- Get vault training status
- update() : bool
- Update vault entry with new data
- callAPI() : array<string|int, mixed>
Properties
$apiendpoint
private
mixed
$apiendpoint
= ""
$apikey
private
mixed
$apikey
$throwError
private
mixed
$throwError
= false
Methods
__construct()
Initialize Vault API with an API key, and optional region (US, EU)
public
__construct(string $apikey[, string $region = "US" ]) : void
Parameters
- $apikey : string
-
You API key
- $region : string = "US"
-
US/EU
Tags
Return values
void —addImage()
Add a document or face image into an existing vault entry
public
addImage(string $vault_id, string $image, int $type) : array<string|int, mixed>
Parameters
- $vault_id : string
-
Vault entry ID
- $image : string
-
Image file path, base64 content or URL
- $type : int
-
Type of image: 0 = document, 1 = person
Tags
Return values
array<string|int, mixed> —New image information array
delete()
Delete a single or multiple vault entries
public
delete(mixed $vault_id) : bool
Parameters
- $vault_id : mixed
-
Vault entry ID or array of IDs
Tags
Return values
bool —deleteImage()
Delete an image from vault
public
deleteImage(string $vault_id, string $image_id) : bool
Parameters
- $vault_id : string
-
Vault entry ID
- $image_id : string
-
Image ID
Tags
Return values
bool —get()
Get a single vault entry
public
get(string $vault_id) : array<string|int, mixed>
Parameters
- $vault_id : string
-
Vault entry ID
Tags
Return values
array<string|int, mixed> —list()
List multiple vault entries with optional filter, sorting and paging arguments
public
list([array<string|int, mixed> $filter = array() ][, string $orderby = "createtime" ][, string $sort = "DESC" ][, int $limit = 10 ], int $offset) : array<string|int, mixed>
Parameters
- $filter : array<string|int, mixed> = array()
-
Array of filter statements, refer to https://developer.idanalyzer.com/vaultapi.html for filter construction
- $orderby : string = "createtime"
-
Field name used to order the results, refer to https://developer.idanalyzer.com/vaultapi.html for available fields
- $sort : string = "DESC"
-
Sort results by ASC = Ascending, DESC = DESCENDING
- $limit : int = 10
-
Number of results to return
- $offset : int
-
Offset the first result using specified index
Tags
Return values
array<string|int, mixed> —searchFace()
Search vault using a person's face image
public
searchFace(string $image[, int $maxEntry = 10 ][, float $threshold = 0.5 ]) : array<string|int, mixed>
Parameters
- $image : string
-
Face image file path, base64 content or URL
- $maxEntry : int = 10
-
Number of entries to return, 1 to 10.
- $threshold : float = 0.5
-
Minimum confidence score required for face matching
Tags
Return values
array<string|int, mixed> —List of vault entries
throwAPIException()
Whether an exception should be thrown if API response contains an error message
public
throwAPIException([bool $throwException = false ]) : void
Parameters
- $throwException : bool = false
-
Enable or Disable APIException being thrown
Return values
void —trainFace()
Train vault for face search
public
trainFace() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —trainingStatus()
Get vault training status
public
trainingStatus() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —update()
Update vault entry with new data
public
update(string $vault_id[, array<string|int, mixed> $data = array() ]) : bool
Parameters
- $vault_id : string
-
Vault entry ID
- $data : array<string|int, mixed> = array()
-
Key-value associative array of the field name and its value
Tags
Return values
bool —callAPI()
private
callAPI(string $action[, array<string|int, mixed> $payload = array() ]) : array<string|int, mixed>
Parameters
- $action : string
- $payload : array<string|int, mixed> = array()