new Vault(apikey, region)
Initialize Vault API with an API key, and optional region (US, EU)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
apikey |
string | You API key | |
region |
string | US | US/EU |
- Source:
Throws:
Error
Methods
addImage(id, image, type) → {Promise.<object>}
Add a document or face image into an existing vault entry
Parameters:
Name | Type | Default | Description |
---|---|---|---|
id |
string | Vault entry ID | |
image |
string | Image file path, base64 content or URL | |
type |
number | 0 | Type of image: 0 = document, 1 = person |
- Source:
Throws:
Error
Returns:
New image object
- Type
- Promise.<object>
delete(id) → {Promise.<object>}
Delete a single or multiple vault entries
Parameters:
Name | Type | Description |
---|---|---|
id |
* | Vault entry ID or array of IDs |
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>
deleteImage(vaultId, imageId) → {Promise.<object>}
Delete an image from vault
Parameters:
Name | Type | Description |
---|---|---|
vaultId |
string | Vault entry ID |
imageId |
string | Image ID |
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>
get(id) → {Promise.<object>}
Get a single vault entry
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Vault entry ID |
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>
list() → {Promise.<object>}
List multiple vault entries with optional filter, sorting and paging arguments
Parameters:
Name | Type | Description |
---|---|---|
options.filter |
Array | Array of filter statements, refer to https://developer.idanalyzer.com/vaultapi.html for filter construction |
options.orderby |
string | Field name used to order the results, refer to https://developer.idanalyzer.com/vaultapi.html for available fields |
options.sort |
string | Sort results by ASC = Ascending, DESC = DESCENDING |
options.limit |
number | Number of results to return |
options.offset |
number | Offset the first result using specified index |
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>
searchFace(image, maxEntry, threshold) → {Promise.<object>}
Search vault using a person's face image
Parameters:
Name | Type | Default | Description |
---|---|---|---|
image |
string | Face image file path, base64 content or URL | |
maxEntry |
number | 10 | Number of entries to return, 1 to 10. |
threshold |
number | 0.5 | Minimum confidence score required for face matching |
- Source:
Throws:
Error
Returns:
List of vault entries
- Type
- Promise.<object>
trainFace() → {Promise.<object>}
Train vault for face search
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>
trainingStatus() → {Promise.<object>}
Get vault training status
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>
update(id, data) → {Promise.<object>}
Update vault entry with new data
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Vault entry ID |
data |
object | Key-value pairs of the field name and its value |
- Source:
Throws:
Error
Returns:
- Type
- Promise.<object>