> For the complete documentation index, see [llms.txt](https://valify.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valify.gitbook.io/documentation/apis/transliteration/national-id-transliteration.md).

# National ID Transliteration

***

The Transliteration service allows you to convert Arabic data extracted from the National ID into their English equivalents. It is different from Translation in that it does not return the meaning of the word, but its proper pronunciation in another language. This service is very useful for faster/automated data entry.

## <mark style="color:blue;">Transliteration (Arabic to English)</mark>

<mark style="color:green;">`POST`</mark> `https://valifystage.com/api/v1/transliterate/egy-nid/`

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Content-Type  | string | application/json       |
| Authorization | string | Bearer \<access-token> |

#### Request Body

| Name                                   | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bundle\_key                            | string | A bundle key provided to you by Valify.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| data<mark style="color:red;">\*</mark> | object | <p>Object containing at least one of the parameters below:<br><code>{</code> <br><code>"first\_name": \<str>,</code></p><p><code>"full\_name": \<str>,</code></p><p><code>"street": \<str>,</code></p><p><code>"area": \<str>,</code></p><p><code>"front\_nid": \<str>,</code></p><p><code>"serial\_number": \<str>,</code></p><p><code>"back\_nid":' \<str>,</code></p><p><code>"expiry\_date": \<str>,</code></p><p><code>"release\_date": \<str>,</code></p><p><code>"date\_of\_birth": \<str>,</code></p><p><code>"gender": \<str>,</code></p><p><code>"religion": \<str>,</code></p><p><code>"husband\_name":\<str>,</code></p><p><code>"marital\_status": \<str></code><br><code>}</code><br></p> |

**Status Codes**

{% tabs %}
{% tab title="✅200 Success" %}

<pre class="language-python"><code class="lang-python">{
    'result': {
        'first_name': '&#x3C;str>',
        'full_name': '&#x3C;str>',
<strong>        'street': '&#x3C;str>',
</strong>        'area': '&#x3C;str>',
        'front_nid': '&#x3C;str>',
        'serial_number': '&#x3C;str>',
        'back_nid': '&#x3C;str>',
        'release_date': '&#x3C;str>',
        'gender': '&#x3C;str>',
        'marital_status': '&#x3C;str>',
        'profession': '&#x3C;str>',
        'religion': '&#x3C;str>',
        'husband_name': '&#x3C;str>',
        'expiry_date': '&#x3C;str>'
    }, 
    'transaction_id': '&#x3C;str>',
    'trials_remaining': '&#x3C;int>'
}
</code></pre>

{% endtab %}

{% tab title="400 Missing input data" %}

```python
{
    "message": "Bad Request – invalid request received (e.g. missing Bundle key, required parameters or invalid json) | Make sure all the required parameters are included"
}
```

{% endtab %}

{% tab title="401 Invalid bundle key" %}

```python
{
    "message": "Unauthorized – your Bundle key is invalid"
}
```

{% endtab %}

{% tab title="403 Access token error" %}

```python
{
    "message": "Forbidden – specified access_token could not be found"
}
```

{% endtab %}

{% tab title="404 Check the endpoint" %}

```python
{
    "message": "Not Found"
}
```

{% endtab %}

{% tab title="415 The format should be base64" %}

```python
{
    "message": "Unsupported Media Type"
}
```

{% endtab %}

{% tab title="422 Check Valify error codes" %}

```python
{
    "message": "<error-description>",
    "error_code": <valify-error-code>
}
```

{% endtab %}

{% tab title="500 Contact us" %}

```python
{
    "message": "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

***

## Integration

{% tabs %}
{% tab title="🐍Python 3" %}

```python
import requests
import base64

token = '<token>' 
data = {
    'bundle_key': '<str>',
    'data':{
        'first_name': '<str>', 
        'full_name': '<str>',
        'street': '<str>',
        'police_station': '<str>',
        'governorate': '<str>',
        'front_nid': '<str>',
        'serial_number': '<str>', 
        'back_nid': '<str>',
        'expiry_date': '<str>',
        'release_date': '<str>',
        'date_of_birth': '<str>',
        'gender': '<str>',
        'religion': '<str>',
        'husband_name':'<str>',
        'marital_status': '<str>'
    }
}

r = requests.post("https://valifystage.com/api/v1/transliterate/egy-nid/",
        json=data,
        headers={'Authorization': 'Bearer %s' % token}
    )
                      
print(r.json())
```

{% endtab %}
{% endtabs %}
