# Face Query

## API Method

## Query

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/innov-face/facequery/query`

This API enables the querying and match the facial image in database to check for existence

#### Request Body

| Name                                        | Type   | Description                                                       |
| ------------------------------------------- | ------ | ----------------------------------------------------------------- |
| apiKey<mark style="color:red;">\*</mark>    | string | To be assigned by Innov8tif                                       |
| imageBase64                                 | string | Selfie image or portrait image in base64                          |
| imageFile<mark style="color:red;">\*</mark> | string | Selfie image or portrait image                                    |
| groupName<mark style="color:red;">\*</mark> | string | Group name that existed in database that matches the facial image |

{% tabs %}
{% tab title="200 " %}
**When image is found in the group (database table):**

{% code title="Response Code Block" %}

```
{
    "status": "success",
    "resultFound": true,
    "groupFound": true,
    "name": "zhiyan",
    "score": 0.0}
```

{% endcode %}

**When group does exists but cannot find similar face:**

{% code title="Response Code Block" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": true
}
```

{% endcode %}

**When group does not exist:**

{% code title="Response Code Block" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": false
}
```

{% endcode %}

**When there is no face detected in the submitted image file:**

{% code title="Response Code Block" %}

```
{
    "status": "error",
    "message": "There is No Face Detected in Image",
    "resultFound": false,
    "groupFound": false
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
