# Doc Liveness and ID Forgery

{% embed url="<https://drive.google.com/file/d/1I_Is6k-MYLtdNYJZjVvj-rM5iUBZ4jdu/view?usp=sharing>" %}

### Steps to Install and Run the ID Liveness Docker

#### Step 1:

Pull Accura ID Liveness Docker image using the command `docker pull accurascan/docliveness:<latest tag>`

{% hint style="info" %}
Visit <https://hub.docker.com/r/accurascan/docliveness> to check the latest version available
{% endhint %}

{% code title="Example:" fullWidth="false" %}

```
docker pull accurascan/docliveness:37.0.0
```

{% endcode %}

#### Step 2:

Run the docker by using the command: `sudo docker run -dp port-you-want-accuraliveness-to-run-on:443 -- restart=always accurascan/docliveness:<latest tag>`

{% code title="Example" overflow="wrap" %}

```
docker run -dp 8043:443 --restart=always accurascan/docliveness:37.0.0
```

{% endcode %}

#### Step 3:

{% hint style="info" %}
To generate your Accura Scan license contact <sales@accurascan.com>
{% endhint %}

Upload your license accessing "<mark style="color:blue;">http\://\<yourdomain:port></mark>" using a browser, Example is shown in the image below.

<figure><img src="https://2173810795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9ct3oWZAE255BxwYNdp5%2Fuploads%2F2wFKSVhDqfHpesol9lhH%2Fdocliveness_imgs.png?alt=media&#x26;token=1fa15699-ba74-4be3-8abf-1891778f658b" alt=""><figcaption></figcaption></figure>

#### Step 4:

Use <mark style="color:blue;">[https://your-domain-or-ip.com:port/doc\\\_liveness.php](https://docs.accurascan.com/language/docker/https:/your-domain-or-ip.com:port/doc\\_liveness.php)</mark> (POST request) to access the API, an example post request as shown below.

<mark style="color:green;">`POST`</mark> `https://yourdomain:port/doc_liveness.php`

{% hint style="info" %}
To view country\_code and card\_code for any card visit <https://accurascan.com/documents-supported-api>
{% endhint %}

#### Request Body

> You can either pass image file or an image base64.

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>image<mark style="color:red;">*</mark></td><td>file</td><td>Upload your image file</td><td></td></tr><tr><td>image_base64</td><td>text or string</td><td>paste your image base64 here</td><td></td></tr><tr><td>isface<mark style="color:red;">*</mark></td><td>front/back</td><td>put card side either the card image is front or back</td><td></td></tr><tr><td>country_code<mark style="color:red;">*</mark></td><td>COL</td><td>put country_code of the card image</td><td></td></tr><tr><td>card_code<mark style="color:red;">*</mark></td><td>CLMID</td><td>put card_code of the card image </td><td></td></tr><tr><td>passport<mark style="color:red;">*</mark></td><td>true/false</td><td>if image is a passport put true else put false</td><td></td></tr><tr><td>webcam<mark style="color:red;">*</mark></td><td>true/false</td><td>if image is captured from a webcam put true else if image is captured from a mobile put  false</td><td></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK An example response is shown in the image below" %}

{% endtab %}
{% endtabs %}

<figure><img src="https://2173810795-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9ct3oWZAE255BxwYNdp5%2Fuploads%2FD1YtuzGSviuWxiMgzCo8%2Fdoclivefull_image.png?alt=media&#x26;token=e1ba3909-49ff-4b33-b81d-e9b4eda19531" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The preferred threshold is **55%**, meaning that if an image achieves a score above this threshold, the ID shown is considered ***Live***; otherwise, it is identified as a ***Spoof***.
{% endhint %}
