# Quick Start

## Get your API key

Your API requests are authenticated using API key. Any request that doesn't include an API key will return an error.

You can contact <info@vlenseg.com> to generate an API key at any time.

## Make your first Egyptian ID front OCR request

To make your first request, send an authenticated request to the endpoint.

{% tabs %}
{% tab title="curl" %}

```
curl -X 'POST' 'https://api.vlenseg.com/v1/ocr/id/front' \
  -H 'Content-Type: application/json' \
  -H 'accept: text/plain' \
  -H 'ApiKey: ApiKeyValueInPortal' \
  -d '{
  "image": "base64",
  "transaction_id": "transaction-guid",
  "client_transaction_id": "client-transaction-id",
  "request_id": "request-guid"
}'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://api.vlenseg.com/v1/ocr/id/front"
headers = {
    "Content-Type": "application/json",
    "accept": "text/plain",
    "ApiKey": "ApiKeyValueInPortal"
}
data = {
    "image": "base64",
    "transaction_id": "transaction-guid",
    "client_transaction_id": "client-transaction-id",
    "request_id": "request-guid"
}

response = requests.post(url, headers=headers, json=data)
print(response.text)

```

{% endtab %}

{% tab title=".Net" %}

```
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    private static readonly HttpClient client = new HttpClient();

    static async Task Main()
    {
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri("https://api.vlenseg.com/v1/ocr/id/front"),
            Headers = {
                { "accept", "text/plain" },
                { "ApiKey", "ApiKeyValueInPortal" }
            },
            Content = new StringContent(
                "{\"image\": \"base64\", \"transaction_id\": \"transaction-guid\", \"client_transaction_id\": \"client-transaction-id\", \"request_id\": \"request-guid\"}",
                Encoding.UTF8,
                "application/json"
            )
        };

        HttpResponseMessage response = await client.SendAsync(request);
        response.EnsureSuccessStatusCode();
        string responseBody = await response.Content.ReadAsStringAsync();
        Console.WriteLine(responseBody);
    }
}

```

{% endtab %}

{% tab title="Java" %}

```
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://api.vlenseg.com/v1/ocr/id/front");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("accept", "text/plain");
            connection.setRequestProperty("ApiKey", "ApiKeyValueInPortal");
            connection.setDoOutput(true);

            String jsonInputString = "{\"image\": \"base64\", \"transaction_id\": \"transaction-guid\", \"client_transaction_id\": \"client-transaction-id\", \"request_id\": \"request-guid\"}";
            try (OutputStream os = connection.getOutputStream()) {
                byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
            }

            int responseCode = connection.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String inputLine;
                StringBuilder response = new StringBuilder();

                while ((inputLine = in.readLine()) != null) {
                    response.append(inputLine);
                }
                in.close();

                System.out.println(response.toString());
            } else {
                System.out.println("POST request not worked");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

```

{% endtab %}

{% tab title="Java Script" %}

```
const fetch = require('node-fetch');

const url = 'https://api.vlenseg.com/v1/ocr/id/front';
const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'accept': 'text/plain',
        'ApiKey': 'ApiKeyValueInPortal',
        'BundleKey': 'BundleKeyValue'
    },
    body: JSON.stringify({
        image: 'base64',
        transaction_id: 'transaction-guid',
        client_transaction_id: 'client-transaction-id',
        request_id: 'request-guid'
    })
};

fetch(url, options)
    .then(response => response.text())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

```

{% endtab %}
{% endtabs %}
