# Api LiveID+

API for third parties integration with LiveID+ video identification platform.

You can subscribe to the LiveID+ service on the <a target="_blank" href="https://status.namirial.com">Namirial status page</a> to receive updates on important releases.

Version: 2.0.0

## Servers

Test
```
https://liveid.test.namirialtsp.com
```

Production
```
https://liveid.namirialtsp.com
```

## Security

### ConferenceToken

Bearer Token provided on call closing or generated with [genAPIToken](/products/liveidplus/enterprise/developer-documentation/api-definition/authenticate/genapitoken)

Type: http
Scheme: bearer
Bearer Format: JWT

### ApiKeyAuth

Organization specific API key provided by Namirial LiveID+ team

Type: apiKey
In: header
Name: apikey

## Download OpenAPI description

[Api LiveID+](https://docs.namirial.app/_bundle/@l10n/it/products/liveidplus/enterprise/developer-documentation/api-definition.yaml)

## app

Endpoints to initiate a call on LiveID+

### service-asyncall

 - [GET /app/service-asyncall](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/app/serviceasyncall.md): In addition to perform a "synchronous" call (the customer calls and is immediately redirected to platform test, then to the first available operator) it's also possible to perform an "asynchronous" call: the customer provides his data and then requests a video identification, which will be managed in another moment by operator (eg: calendar management). To do this LiveID+ platform provides two methods: pushAsyncCall and service-asyncall.

service-asyncall method retrieves the loaded call using pushAsyncCall and then start the video identification (redirects to platform test, then to the first available or requested operator).

Please note: calls to "service-asyncall" will automatically redirect caller to LiveID + platform test so it can be provided as a link directly to the customer (eg: confirmation email of the appointment generated by the operator).

### service-start

 - [POST /app/service-start](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/app/servicestart.md): Start the process for a video identification. It can be a live session with an operator or a self process, or a combination of both (in this case, a selection method should be discussed in advance with Namirial).\
At the end of the process, or in case of errors, the page will be redirected to the redirectUrl (if specified) passing a LiveIDPlusResult POST parameter, containing the JSON result message in the same format specified in the Call closing section.

There are two ways to integrate LiveID+:
- standalone mode: the call is launched in a new browser tab and provides a server-side callback and a rediderct URL for client-side callbacks;
- embedded mode: the call is launched within an HTML iframe directly in the client procedure, allowing for client-side callbacks (in form of window.postMessage) as described in the network and media test and call status check [Client side events section and Call closing section).

In case of embedded mode, the iframe must have allow property set to include geolocation, camera, and microphone access, as following:

allow="geolocation; camera; microphone"

If this API is used to start a single video identification process, the id_process parameter is mandatory.\
If LiveID+ should automatically perform a check to decide whether to use a live process or a self process, the id_process_live and id_process_self are mandatory. The procedure to determine which process to choose has to be discussed with Namirial in the set up phase.\
The id_process parameter and id_process_self, id_process_live couple are mutually exclusive.

### service-webrtc-test

 - [POST /app/service-webrtc-test](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/app/servicewebrtctest.md): service-webrtc-test is in the process of being deprecated. For initial integration with LiveID+, it is strongly recommended to use the service-start API.

To initiate a video identification, a request to the LiveID+ system has to be performed in order to check the compatibility of the customer's device with the platform. Only if this check is successful will the video identification process begin.

There are two modes in which the video identification call can be initiated:
- standalone mode: the call is launched in a new browser tab and does not allow for client-side closing callbacks;
- embedded mode: the call is launched within an HTML iframe directly in the client procedure, allowing for client-side callbacks (in form of window.postMessage) as described in the Client side events section and Call closing section).

If you choose to use embedded mode, the iframe must have the allow property set to include geolocation, camera, and microphone access, as following:\
allow="geolocation; camera; microphone"

## authenticate

Endpoints to manage authentication and generate session tokens

### genAPIToken

 - [GET /api/authenticate/genAPIToken](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/authenticate/genapitoken.md): Retrieve a call specific access token for interaction with other LiveID+ integration features.

## service

General service endpoints for checking status, queue information, and available operators

### pushAsyncCall

 - [POST /api/service/pushAsyncCall](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/pushasynccall.md): In addition to synchronous call - where the customer initiate a call and is immediately redirected to the network and media test, then to the first available operator - LiveID+ also supports asynchronous calls.\
In this mode, the customer submits their information to request a video identification, which an operator will handle at a later time (e.g.: through scheduled appointment).\
This can be done using two methods: pushAsyncCall and service-asyncall.

pushAsyncCall method puts a video identification call in the system without it being immediately redirected to platform test and then to the first available operator.\
Calls entered using pushAsyncCall are linked to the unique ID provided in the response and can then be initiated using service-asyncall.

### delAsyncCall

 - [DELETE /api/service/delAsyncCall](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/delasynccall.md): Delete an async call previously added in the system

### availableLanguages

 - [POST /api/service/availableLanguages](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/availablelanguages.md): Retrieve all the languages spoken by operators of a specific organization.

### getDailyWaitingTimes

 - [POST /api/service/getDailyWaitingTimes](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/getdailywaitingtimes.md): Retrieve the average daily waiting time of the last week (in seconds) and of the last 60 minutes, for a single organization

### getAvailableOperators

 - [POST /api/service/getAvailableOperators](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/getavailableoperators.md): Retrieve the number of the operators currently available to answer calls

### getCallInfoUID

 - [POST /api/service/getCallInfoUID](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/getcallinfouid.md): Retrieve the details about the last call related to the async UID passed.

To retrieve all the calls related to the async UID, use the getAsyncRequestInfo method of the v2 API.

### getQueue

 - [POST /api/service/getQueue](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/service/getqueue.md): Retrieve the number of people in queue for a specified process

## v1

General conference management endpoints (Version 1)

### conferenceData

 - [GET /api/v1/conferenceData](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v1/conferencedata.md): Retrieve LiveID+ video identification calls data

Notice: for details about module structure provided in "data" parameter see this ConferenceData response: module structure

### deleteAuditData

 - [DELETE /api/v1/deleteAuditData](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v1/deleteauditdata.md): Delete all the artifacts (audio, video, photos and shared documents) stored in LiveID+ relative to the served conference id.
The textual audit data won't be deleted; to force deleting the audit data and all the data stored in the database is available the "eraseAll" parameters.

### checkStatus

 - [GET /api/v1/checkStatus](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v1/checkstatus.md): Check if the service is active

### getAuditData (deprecated)

 - [GET /api/v1/getAuditData](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v1/getauditdatav1.md): Retrieve LiveID zip containing the audit data and identification call photo's.

(Please consider that it's highly recommended to use the v2 version of this API)

## v2

General conference management endpoints (Version 2)

### getAuditData

 - [GET /api/v2/getAuditData](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v2/getauditdatav2.md): Retrieve LiveID zip containing the audit data and recognition call photo's. Unless otherwise specified with the direct parameter, an url will be returned where you can download the zip.

### rejectCall

 - [PATCH /api/v2/rejectCall](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v2/rejectcall.md): Reject a call as if it was rejected by the system

### getAsyncRequestInfo

 - [GET /api/v2/getAsyncRequestInfo](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v2/getasyncrequestinfo.md): Retrieve the details about all the calls related to the async UID passed

### registerAlertEmail

 - [POST /api/v2/registerAlertEmail](https://docs.namirial.app/it/products/liveidplus/enterprise/developer-documentation/api-definition/v2/registeralertemail.md): Register one or more email addresses to receive alerts about the server callbacks of a process.
Pay attention: each registration will override the previous email address registered for the process.

