# /ocr\_card

#### Endpoint

```http
https://be.progeny.tech/api/v3/services/ocr_card/
```

#### Purpose

Allows you to connect to the OCR\_Card service, using the provider configured in the **Progeny Console**, to extract an image from a driving license or ID.

{% hint style="info" %}
Please refer to the section on [images](https://docs.progeny.tech/overview#a-quick-word-about-images) for guidance before posting.  For the best results, we recommend a maximum height of 1080px.
{% endhint %}

#### Sample request and response

## Get task Id

<mark style="color:green;">`POST`</mark> `https://be.progeny.tech/api/v3/services/ocr_card/`

#### Request Body

| Name                                        | Type   | Description                                                                                        |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------- |
| front\_id<mark style="color:red;">\*</mark> | String | Scanned Image of user's ID (front) in PNG, JPEG or JPG file format                                 |
| back\_id<mark style="color:red;">\*</mark>  | String | Scanned Image of user's ID (back)  in PNG, JPEG, or JPG file format                                |
| extend\_data                                | String | Set to true to retrieve the original response from the 3rd-party provider of the OCR\_Card service |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "id": "08bcb59c-c01c-42b9-b666-44df639cff78"
}
```

{% endtab %}

{% tab title="400: Bad Request Image is missing or not in the correct format" %}

```javascript
{
    "selfie_image": [
        "No file was submitted."
    ],
    "front_id": [
        "No file was submitted."
    ],
    "back_id": [
        "No file was submitted."
    ],
    "extend_data": [
        "This field is required."
    ]
}
```

{% endtab %}
{% endtabs %}

## Extract an image from a driving license or ID

<mark style="color:blue;">`GET`</mark> `https://be.progeny.tech/api/v3/services/task/?id={{task_id}}`

#### Path Parameters

| Name | Type   | Description                                     |
| ---- | ------ | ----------------------------------------------- |
| id   | String | The task Id you obtained from your POST request |

{% tabs %}
{% tab title="200: OK Success" %}

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

{% endtab %}

{% tab title="400: Bad Request Image does not meet requirements" %}

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

{% endtab %}
{% endtabs %}
