# Welcome to smartTools

## Who is Laigo?

Laigo GmbH is a leading provider of AI services for businesses, offering a secure and compliant turn-key solution to facilitate the integration of AI into their operations. We believe providing easy-to-use machine learning for everyone is key.

## Why Laigo?

**Smart**: easy and simple access to AI through a REST API, allowing organizations to harness its power without the need for extensive technical knowledge

**Secure**: hosting our solution on our servers located in Germany and avoiding the use of any US-based services. Our commitment to privacy is demonstrated through our strict data management policies, which ensure that all processed data is deleted after use.

**Compliant**: fully compliant with GDPR regulations and equipped to meet the requirements of the upcoming EU-AI Act. Our reporting capabilities allow organizations to easily maintain compliance and ensure that their use of AI aligns with the latest regulatory standards.

## What is smartTools?

SmartTools represent a category of AI-driven software solutions meticulously engineered to augment the functionality of various tools. These tools encompass an array of capabilities, including automated data flow orchestration, extracting meaningful insights from data, streamlining the process of digitizing information, and prioritizing intelligent document processing. This includes advanced text recognition mechanisms for comprehending and extracting textual content, along with the ability to organize data in a structured manner. Smartools excel in extracting pertinent details from diverse documents such as invoices, receipts, and contracts, ensuring the transformation of unstructured data into a structured format. Furthermore, they excel in categorizing documents into specific types, facilitating efficient document classification. By amalgamating artificial intelligence, machine learning, and data analysis techniques, smartools aspire to revolutionize the way tools operate, offering enhanced automation, data utilization, and information extraction capabilities.

<div align="center" data-full-width="false"><figure><img src="/files/F5Ufzg6iO8bL3rxJPH9T" alt=""><figcaption><p><mark style="color:blue;">smartICR</mark><br><br>Text recognition in<br>120+ languages</p></figcaption></figure> <figure><img src="/files/6PEknWJnWbP39IFbmMB1" alt=""><figcaption><p><mark style="color:blue;">smartClassify</mark><br><br>Classification of 12<br>document types</p></figcaption></figure> <figure><img src="/files/kUNq5m6eRvyKIPxzPqBu" alt=""><figcaption><p><mark style="color:blue;">smartInvoice</mark><br><br>Data extraction of invoices</p></figcaption></figure> <figure><img src="/files/zbN9rzvkhXLHM6R5wRgt" alt=""><figcaption><p><mark style="color:blue;">smartReceipt</mark><br><br>Data extraction of receipts</p></figcaption></figure> <figure><img src="/files/xK5ujh39kINqxn42eeoF" alt=""><figcaption><p><mark style="color:blue;">smartDocSplit</mark><br><br>Page stream segmentation</p></figcaption></figure> <figure><img src="/files/bRr9tAEc5UUa5TGchlfK" alt=""><figcaption><p><mark style="color:blue;">smart</mark><br><mark style="color:blue;">TableExtraction</mark><br>Data Extraction for tables</p></figcaption></figure></div>

## Who is the target audience for smartTools?

At Laigo, the primary focus of smartTools is to support the development community by providing a user-friendly API access. With this, Laigo offers developers the flexibility to integrate AI models into various software systems such as DSM, ERP, ECM, and BPM. This capability enables organizations to enhance their existing software systems with cutting-edge AI technology, providing new levels of efficiency and productivity.\ <br>


# Setup your Account

## Sign-Up

To access smartTools, you have the option of creating an account via the sign-up button. To create an account using the sign-up button, please follow these simple steps:

Go to the[ sign-up page](https://app.laigo.io/register/HxB4EQdYUxJYEAcKUQFUAgNSTlFUVgcVVVYIAhgHBVAESAFUUVMAVVNXAFIEUhsfQHFGBFgKE1xjEUJcVxdHYwAED11AbBg=)

1. Enter your first and last name.
2. Enter your email address, and your desired password.
3. Once you’ve read the [terms of use](https://laigo.ai/terms-and-conditions/) and our [privacy policy](https://laigo.ai/privacy-policy/) agree to it, click on the first checkbox.
4. Click on Sign Up.
5. Check your email or spam box for confirmation and follow the instructions in the email to activate your account.

<figure><img src="/files/GcSNVfRbCdMCh91T6Ics" alt=""><figcaption></figcaption></figure>

Enhance your profile by registering:

<figure><img src="/files/PIqFB3iTCqFNQbVctfy0" alt=""><figcaption></figcaption></figure>

## Log-In

If you already have an account for smartTools, follow these steps to log in to your account.

1. Go to the [Log-in](https://account.laigo.io/realms/SmartTools/protocol/openid-connect/auth?client_id=account-console\&redirect_uri=https%3A%2F%2Faccount.laigo.io%2Frealms%2FSmartTools%2Faccount%2F\&state=44ccafb0-e2a7-4298-b207-fe957414c57d\&response_mode=fragment\&response_type=code\&scope=openid\&nonce=ecbebd18-688f-4f1a-8c08-6629743219c6\&code_challenge=dud5kHq5taaYVKzLpFYwNhZerM4R5pW89FIWilCfgkU\&code_challenge_method=S256) page.
2. Enter your email address and password.
3. Click on Log in.

## Recover Account

1. Click the link **password forgotten**.

If you have forgotten your password, follow these steps to recover your account.<br>

<figure><img src="/files/4Y39BdSU2lXUwvRtuT8N" alt=""><figcaption></figcaption></figure>

2. Add your email address that you used to create an account for smartTools and click on **send** an email.<br>

   <figure><img src="/files/ubkGbFC8I3T3nQqxq7uO" alt=""><figcaption></figcaption></figure>


# Make your first Request

\
Get your token

1. Before you can use any of the APIs, you need to log in to your Laigo account or, if you don’t have one, [create a new one.](https://app.laigo.io/register/HxB4EQdYUxJYEAcKUQFUAgNSTlFUVgcVVVYIAhgHBVAESAFUUVMAVVNXAFIEUhsfQHFGBFgKE1xjEUJcVxdHYwAED11AbBg=)
2. For creating the token, please visit our [platform](https://app.laigo.io/) and go to Administration- API Keys page to create and copy your client credentials.

<figure><img src="/files/UTpmbj5XQ90QUaweNHVa" alt=""><figcaption></figcaption></figure>

3. Once you logged in, then you can start to create your client secret and client id by selecting the API page on the left sidebar of the dashboard.

<figure><img src="/files/xMmJJRa1riDVDA4VyjDo" alt=""><figcaption></figcaption></figure>

3. For generating your client\_id and client\_secret you must fill the 'API Client Friendly Name' then click on the button ‘Generate’. The credentials that you can use for creating a token are now available.

<figure><img src="/files/xMmJJRa1riDVDA4VyjDo" alt=""><figcaption></figcaption></figure>

5. Create an access token. To request access tokens, an application must make a POST request with the following multipart form data to the token URI: **grant\_type=client\_credentials**.

The application must pass basic HTTP auth credentials using the **client\_id** as the user and **client\_secret** as the password access tokens are obtained by calling the **<https://account.laigo.io/realms/SmartTools/protocol/openid-connect/token>** endpoint, and the required secrets are available in the API tab for your need.

**Create an access token**

***

<mark style="color:green;">`POST`</mark> `https://account.laigo.io/realms/SmartTools/protocol/openid-connect/token`

#### Query Parameters

| Name                                             | Type   | Description                                                 |
| ------------------------------------------------ | ------ | ----------------------------------------------------------- |
| client\_id<mark style="color:red;">\*</mark>     | String | The ClientId that has been generated for this function.     |
| client\_secret<mark style="color:red;">\*</mark> | String | The ClientSecret that has been generated for this function. |
| grant\_type<mark style="color:red;">\*</mark>    | String | Here you put your client credentials                        |

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

{% endtab %}

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

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

{% endtab %}

{% tab title="404: Not Found Not Found" %}

{% endtab %}
{% endtabs %}

***

**Get your sample code**

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

```
curl -X POST "https://account.laigo.io/realms/SmartTools/protocol/openid-connect/token" \
     -d "client_id=<clientId>" \
     -d "client_secret=<clientSecret>" \
     -d "grant_type=client_credentials"
```

{% endtab %}

{% tab title="C#" %}

```csharp
string tokenUrl = "https://account.laigo.io/realms/SmartTools/protocol/openid-connect/token";
using (HttpClient client = new HttpClient())
{
    var formData = new List<KeyValuePair<string, string>>
            {
                new KeyValuePair<string, string>("client_id", "<client_id>"),
                new KeyValuePair<string, string>("client_secret", "<client_secret>"),
                new KeyValuePair<string, string>("grant_type", "client_credentials")
            };

    var response = await client.PostAsync(tokenUrl, new FormUrlEncodedContent(formData));
    string responseContent = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseContent);
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

token_url = 'https://account.laigo.io/realms/SmartTools/protocol/openid-connect/token'
data = {'client_id': '<clientId>', 'client_secret': '<clientSecret>', 'grant_type': 'client_credentials'}

result = requests.post(token_url, data = data)
print(result.text)
```

{% endtab %}
{% endtabs %}

### Expected response

```
{
   "access_token":"USVb1nGO9kwQlhNRRnI4iWVy2UV5j7M6h7",
   "expires_in":300,
   "refresh_expires_in":0,
   "token_type":"Bearer",
   "not-before-policy":0,
   "scope":"smarttools:accounting smarttools:consumption"
}
```

## Uploading a new document

Once your access tokens are obtained by following the steps shown above the required secrets are available in the API tab for your task.\
**In our example we will show how to use the API call to the smartICR tool.** \
First you have to make a POST request to the following route, since you are uploading a new document.

## Upload file to smartICR

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/smartICR`

#### Query Parameters

| Name                                            | Type   | Description                                                                                                                                                                 |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>         | String | If you want to sent the result to your email, you can define the destination email with this parameter                                                                      |
| outputFormats<mark style="color:red;">\*</mark> | String | As output format you can choose PDF and/ TEXT (e.g. outputFormats=PDF,TEXT)                                                                                                 |
| languageHint                                    | String | If you prefer the detection in a special language, you can force to use a language. Default Language is English. For choosing a Language, use the ISO-Langauge Code – 639-1 |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Response result will be the job id" %}

{% endtab %}
{% endtabs %}


# Smart Table Extraction

Welcome to the Smart Table Extraction documentation, your gateway to an innovative solution that simplifies the extraction of structured data from tables within documents. Smart Table Extraction is a powerful tool designed to save you time and effort in the often tedious task of manually extracting data from tables. Whether you're dealing with financial reports, invoices, or any document containing tabular data, our technology can automatically identify, extract, and organize that data for you. This documentation will guide you through the features, capabilities, and best practices to help you harness the full potential of Smart Table Extraction, transforming the way you work with tabular data.

To use Smart Table Extraction you navigate to Table Extraction Page  where you can drag and drop the file that you want to extract from.

<figure><img src="/files/G8wwqzyaS4cxAfS4tkxj" alt=""><figcaption></figcaption></figure>

After the processing step, platform gives the option to download the processed file.

<figure><img src="/files/wCjA8AanhsbNeqfV29xi" alt=""><figcaption></figcaption></figure>


# Smart Tools

Welcome to the SmartTools documentation, your gateway to a cutting-edge solution that leverages the power of artificial intelligence to revolutionize document processing. SmartTools is a versatile suite of AI-driven tools designed to streamline and enhance the way you handle documents. Whether you're dealing with large volumes of text, images, or complex data, our AI-powered capabilities can automatically analyze, categorize, and extract valuable insights, making your document workflows more efficient and intelligent. This documentation will provide you with insights into the features, functionalities, and best practices to harness the full potential of SmartTools, enabling you to transform your document processing into a more automated, accurate, and efficient operation.

When you navigate to SmartTools you will see a section where you drag and drop your file and dropdown menu to select your Smart Tool.

<figure><img src="/files/IOU24mw7tHrkO5suh4da" alt=""><figcaption></figcaption></figure>

In this section you select your Tool to process where afterwards you drag and drop your file.

<figure><img src="/files/ejpGuHON7ix3YR9635LZ" alt=""><figcaption></figcaption></figure>

After the file you have the option to download the processed file.

<figure><img src="/files/f3HID9ypmmcPh1Csec7D" alt=""><figcaption></figcaption></figure>


# smartICR

Revolutionize your text extraction process with smartICR, a leading tool in the industry. Utilizing cutting-edge deep learning techniques in computer vision and natural language processing, the software is capable of accurately extracting text from images and videos in over 100 languages. Its use of an LSTM neural network allows for unparalleled performance in sequence prediction, making it impervious to repeated text within image sequences. Experience the efficiency and effectiveness of smartICR today.

### Limitations

Max File Size is **10 MB**\
Max requests per second: **1**\
Processing Time: **Up to the number of characters in an image**

### Licenses

All rights reserved by Laigo

### API Call

## Upload file to smartICR

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/smartICR`

#### Query Parameters

| Name          | Type   | Description                                                   |
| ------------- | ------ | ------------------------------------------------------------- |
| languageHint  | String | Define language of the file content with ISO code (ISO-639-1) |
| outputFormats | String | Define output format(s) like PDF, TXT, JSON. Default is PDF   |
| email         | String | Define receiver email address                                 |
| threshold     | String | Set minimum probability to be reached by model                |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Returns Job Id" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}
{% endtabs %}

### Code snippets

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

```javascript
curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=PDF,TEXT" \
     -F "languageHint=EN" \
     -F "file=@my-file-location-here"
```

{% endtab %}

{% tab title="C#" %}

```csharp
string baseUrl = "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR";
string email = "my-email-here";
string outputFormats = "PDF,TEXT";
string languageHint = "EN";
string token = "Bearer my-accessToken-here";

using (HttpClient client = new HttpClient())
{
 string url = $"{baseUrl}?email={email}&outputFormats={outputFormats}&languageHint={languageHint}";
 var request = new HttpRequestMessage(HttpMethod.Post, url);
 request.Headers.Add("Authorization", token);
 var content = new MultipartFormDataContent();
 content.Add(new StreamContent(File.OpenRead("/my-file-location-here")), "file", "/my-file-location-here");
 request.Content = content;
 var response = await client.SendAsync(request);
 response.EnsureSuccessStatusCode();
 Console.WriteLine(await response.Content.ReadAsStringAsync());
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}
data = {
    "email": "my-email-here",
    "outputFormats": "PDF,TEXT",
    "languageHint": "EN"
}
files = {
    "file": open("my-file-location-here", "rb")
}
response = requests.post(url, headers=headers, data=data, files=files)
response.raise_for_status()
print(response.text)
```

{% endtab %}

{% tab title="HTML & JavaScript" %}

```html
//note that running this code directly from the local file system might not work due to security restrictions.
<input type="file" id="fileInput">
<button id="uploadButton">Upload</button>

<script>
  document.getElementById('uploadButton').addEventListener('click', () => {
    const url = 'https://use.laigo.io/api/FileUpload/v1/Upload/smartICR';
    const token = 'Bearer my-email-here';

    const email = 'my-email-here';
    const outputFormats = 'PDF,TEXT';
    const languageHint = 'EN';

    const fileInput = document.getElementById('fileInput');
    const file = fileInput.files[0];

    const formData = new FormData();
    formData.append('email', email);
    formData.append('outputFormats', outputFormats);
    formData.append('languageHint', languageHint);
    formData.append('file', file);

    const xhr = new XMLHttpRequest();
    xhr.open('POST', url);
    xhr.setRequestHeader('Authorization', token);

    xhr.onload = () => {
      if (xhr.status === 200) {
        console.log(xhr.responseText);
      } else {
        console.error('Request failed:', xhr.statusText);
      }
    };

    xhr.onerror = () => {
      console.error('Request failed');
    };

    xhr.send(formData);
  });
</script>
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();

$url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartICR";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$fields = array(
    "email" => "my-email-here",
    "outputFormats" => "PDF,TEXT",
    "languageHint" => "EN",
    "file" => "@my-file-location-here"
);

curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    echo "Error: " . curl_error($curl);
}

curl_close($curl);

echo $response;
?>
```

{% endtab %}
{% endtabs %}

### Example (Step by Step)

1. First you need to have a document sample that you want to use with smartICR. It can be any document type such as: invoice, receipt, letter, email etc. For e.g you can use the invoice sample below:

<figure><img src="/files/lYdxDfJDCI8BPXZibu9v" alt=""><figcaption></figcaption></figure>

2. Inorder to use our smartICR tool you need to have an API key which can be generated from [here](https://laigo.ai/make-your-first-request/).&#x20;

{% hint style="info" %}
If you don’t have an account, first you need to set up your account then you can generate the API key. [Create an account here.](https://laigo.ai/setup-your-account/)
{% endhint %}

3. After you have generated your API key, then you can use smartICR in any popular programming language, where you can find the code snippets [here](https://laigo.ai/smarticr/).
4. Run your code. You will receive a JSON response with the invoice details.

### Credits (Laigos)

The calcualtion of processing a page:

| Page | Laigos |
| ---- | ------ |
| 1    | 1      |

###


# smartClassify

Streamline your document classification process with SmartClassify, a cutting-edge machine learning tool. Utilizing a combination of text and layout information, the software accurately classifies documents into various categories, including advertisements, delivery notes, emails, forms, handwritten documents, and invoices. With its training on a diverse range of German language documents, including invoices, receipts, emails, and letters, SmartClassify offers a reliable solution for information extraction from scanned documents. Elevate your document understanding capabilities with smartClassify.

### Limitations

Max File Size is **10 MB**\
Max requests per second: **1**\
Processing Time: **Up to the number of characters in an image**

### Licenses

All rights reserved by Laigo

### API Call<br>

## Upload file to smartClassify

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/smartClassify`

#### Query Parameters

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| threshold     | String | Set minimum probability to be reached by model |
| email         | String | Define receiver email address                  |
| outputFormats | String | Define output format(s) like JSON.             |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Returns Job Id" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}
{% endtabs %}

### Code snippets

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

```javascript
curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartClassify" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=JSON" \
     -F "file=@my-file-location-here"
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new HttpClient();

var email = "my-email-here";
var outputFormats = "JSON";

var url = $"https://use.laigo.io/api/FileUpload/v1/Upload/smartClassify?email={Uri.EscapeDataString(email)}&outputFormats={Uri.EscapeDataString(outputFormats)}";

var request = new HttpRequestMessage(HttpMethod.Post, url);
request.Headers.Add("Authorization", "Bearer my-accessToken-here");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("my-file-location-here")), "file", "my-file-location-here");
request.Content = content;

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartClassify"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}

files = {
    "email": (None, "my-email-here"),
    "outputFormats": (None, "JSON"),
    "file": ("sample.pdf", open("my-file-location-here", "rb"))
}

response = requests.post(url, headers=headers, files=files)
print(response.text)
```

{% endtab %}

{% tab title="HTML & JavaScript" %}

```html
<input type="file" id="fileInput">
<button onclick="uploadFile()">Upload</button>
<script>
    function uploadFile() {
        var fileInput = document.getElementById('fileInput');
        var file = fileInput.files[0];
        var formData = new FormData();

        formData.append("email", "my-email-here");
        formData.append("outputFormats", "JSON");
        formData.append("file", file);

        var xhr = new XMLHttpRequest();
        xhr.withCredentials = true;

        xhr.onreadystatechange = function() {
            if (xhr.readyState === 4) {
                if (xhr.status === 200) {
                    console.log(xhr.responseText);
                } else {
                    console.error("Error:", xhr.statusText);
                }
            }
        };

        xhr.open("POST", "https://use.laigo.io/api/FileUpload/v1/Upload/smartClassify");
        xhr.setRequestHeader("Authorization", "Bearer my-accessToken-here");
        xhr.send(formData);
    }
</script>
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();

$url = "https://use.laigo.io/api/File
Upload/v1/Upload/smartClassify";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$data = array(
    "email" => "my-email-here",
    "outputFormats" => "JSON",
    "file" => new CurlFile("my-file-location-here", "application/pdf", "sample.pdf")
);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if ($response === false) {
    echo 'Curl error: ' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Example (Step by step)

1. First you need to have a document sample that you want to use with smartClassify. It can be any document type such as: invoice, receipt, letter, email etc. For e.g you can use the invoice **letter** below:

<figure><img src="/files/tvf7N9Ovx3DJWdiPThsE" alt=""><figcaption></figcaption></figure>

2. Inorder to use our smartClassify tool you need to have an API key which can be generated from [here](https://laigo.ai/make-your-first-request/).&#x20;

{% hint style="info" %}
If you don’t have an account, first you need to set up your account then you can generate the API key. [Create an account here.](https://laigo.ai/setup-your-account/)
{% endhint %}

3. After you have generated your API key, then you can use smartClassify in any popular programming language, where you can find the code snippets [here](https://laigo.ai/smartclassify/).
4. Run your code. You will receive a JSON response with the invoice details.

### Credits (Laigo)

The calculation of processing a page:

| Page | Laigos |
| ---- | ------ |
| 1    | 1      |

###


# smartInvoice

Optimize your data extraction process with the smartInvoice Application, a robust solution for invoice data extraction. The application allows for seamless extraction of important information such as the receiver and sender names and addresses, tax numbers, IBAN and BIC codes, invoice date, and invoice numbers and amounts with customizable percentage calculations. Trained on German and English data and with a range of file layouts and templates, the smartInvoice Application offers a highly effective and efficient means of streamlining your data extraction process.

### Limitations

Max File Size is **10 MB**\
Max requests per second: **1**\
Processing Time: **Up to the number of characters in an image**

### Licenses

All rights reserved by Laigo

### API Call<br>

## Upload file to smartInvoice

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/smartInvoice`

#### Query Parameters

| Name          | Type   | Description                                                 |
| ------------- | ------ | ----------------------------------------------------------- |
| threshold     | String | Set minimum probability to be reached by model              |
| outputFormats | String | Define output format(s) like PDF, TXT, JSON. Default is PDF |
| email         | String | Define receiver email address                               |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Returns Job Id" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}
{% endtabs %}

### Code snippets

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

```javascript
curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartInvoice" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=JSON" \
     -F "file=@my-file-location-here"
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new HttpClient();

var email = "my-email-here";
var outputFormats = "JSON";

var url = $"https://use.laigo.io/api/FileUpload/v1/Upload/smartInvoice?email={Uri.EscapeDataString(email)}&outputFormats={Uri.EscapeDataString(outputFormats)}";

var request = new HttpRequestMessage(HttpMethod.Post, url);
request.Headers.Add("Authorization", "Bearer my-accessToken-here");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("my-file-location-here")), "file", "my-file-location-here");
request.Content = content;

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartInvoice"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}

files = {
    "email": (None, "my-email-here"),
    "outputFormats": (None, "JSON"),
    "file": ("sample.pdf", open("my-file-location-here", "rb"))
}

response = requests.post(url, headers=headers, files=files)
print(response.text)
```

{% endtab %}

{% tab title="HTML & JavaScript" %}

```html
<input type="file" id="fileInput">
<button onclick="uploadFile()">Upload</button>
<script>
    function uploadFile() {
        var fileInput = document.getElementById('fileInput');
        var file = fileInput.files[0];
        var formData = new FormData();

        formData.append("email", "my-email-here");
        formData.append("outputFormats", "JSON");
        formData.append("file", file);

        var xhr = new XMLHttpRequest();
        xhr.withCredentials = true;

        xhr.onreadystatechange = function() {
            if (xhr.readyState === 4) {
                if (xhr.status === 200) {
                    console.log(xhr.responseText);
                } else {
                    console.error("Error:", xhr.statusText);
                }
            }
        };

        xhr.open("POST", "https://use.laigo.io/api/FileUpload/v1/Upload/smartInvoice");
        xhr.setRequestHeader("Authorization", "Bearer my-accessToken-here");
        xhr.send(formData);
    }
</script>
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();

$url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartInvoice";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$data = array(
    "email" => "my-email-here",
    "outputFormats" => "JSON",
    "file" => new CurlFile("my-file-location-here", "application/pdf", "sample.pdf")
);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if ($response === false) {
    echo 'Curl error: ' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Example (Step by step)

1. First you need to have a document sample that you want to use with smartInvoice. It can be any document type such as: invoice, receipt, letter, email etc. For e.g you can use the invoice **letter** below:

<figure><img src="/files/IbA4PEqOYsYD4iq3xm5W" alt=""><figcaption></figcaption></figure>

2. Inorder to use our smartInvoice tool you need to have an API key which can be generated from [here](https://laigo.ai/make-your-first-request/).&#x20;

{% hint style="info" %}
If you don’t have an account, first you need to set up your account then you can generate the API key. [Create an account here.](https://laigo.ai/setup-your-account/)
{% endhint %}

3. After you have generated your API key, then you can use smartInvoice in any popular programming language, where you can find the code snippets [here](https://laigo.ai/smartclassify/).
4. Run your code. You will receive a JSON response with the invoice details.

### Credits (Laigo)

The calculation of processing a page:

| Page | Laigos |
| ---- | ------ |
| 1    | 1      |

###


# smartReceipt

Optimize your data extraction process with the smartReceipt Application, a robust solution for receipt data extraction. The application allows for seamless extraction of important information such as the product listing, prices, amount of products, total amount, date etc. Trained on German and English data and with a range of file layouts and templates, the smartReceipt Application offers a highly effective and efficient means of streamlining your data extraction process.

### Limitations

Max File Size is **10 MB**\
Max requests per second: **1**\
Processing Time: **Up to the number of characters in an image**

### Licenses

All rights reserved by Laigo

### API Call<br>

## Upload file to smartInvoice

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/smartReceipt`

#### Query Parameters

| Name          | Type   | Description                                    |
| ------------- | ------ | ---------------------------------------------- |
| threshold     | String | Set minimum probability to be reached by model |
| outputFormats | String | Define output format(s) like JSON.             |
| email         | String | Define receiver email address                  |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Returns Job Id" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}
{% endtabs %}

### Code snippets

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

```markup
curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartReceipt" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=JSON" \
     -F "file=@my-file-location-here"
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new HttpClient();

var email = "my-email-here";
var outputFormats = "JSON";

var url = $"https://use.laigo.io/api/FileUpload/v1/Upload/smartReceipt?email={Uri.EscapeDataString(email)}&outputFormats={Uri.EscapeDataString(outputFormats)}";

var request = new HttpRequestMessage(HttpMethod.Post, url);
request.Headers.Add("Authorization", "Bearer my-accessToken-here");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("my-file-location-here")), "file", "my-file-location-here");
request.Content = content;

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartReceipt"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}

files = {
    "email": (None, "my-email-here"),
    "outputFormats": (None, "JSON"),
    "file": ("sample.pdf", open("my-file-location-here", "rb"))
}

response = requests.post(url, headers=headers, files=files)
print(response.text)
```

{% endtab %}

{% tab title="HTML & JavaScript" %}

```html
<input type="file" id="fileInput">
<button onclick="uploadFile()">Upload</button>
<script>
    function uploadFile() {
        var fileInput = document.getElementById('fileInput');
        var file = fileInput.files[0];
        var formData = new FormData();

        formData.append("email", "my-email-here");
        formData.append("outputFormats", "JSON");
        formData.append("file", file);

        var xhr = new XMLHttpRequest();
        xhr.withCredentials = true;

        xhr.onreadystatechange = function() {
            if (xhr.readyState === 4) {
                if (xhr.status === 200) {
                    console.log(xhr.responseText);
                } else {
                    console.error("Error:", xhr.statusText);
                }
            }
        };

        xhr.open("POST", "https://use.laigo.io/api/FileUpload/v1/Upload/smartReceipt");
        xhr.setRequestHeader("Authorization", "Bearer my-accessToken-here");
        xhr.send(formData);
    }
</script>
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();

$url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartReceipt";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$data = array(
    "email" => "my-email-here",
    "outputFormats" => "JSON",
    "file" => new CurlFile("my-file-location-here", "application/pdf", "sample.pdf")
);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if ($response === false) {
    echo 'Curl error: ' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Example (Step by step)

1. First you need to have a document sample that you want to use with smartReceipt. It can be any document type such as: invoice, receipt, letter, email etc. For e.g you can use the receipt below:

<figure><img src="/files/C2tnebFmAR0E8QuAdhHt" alt=""><figcaption></figcaption></figure>

2. Inorder to use our smartReceipt tool you need to have an API key which can be generated from [here](https://laigo.ai/make-your-first-request/).&#x20;

{% hint style="info" %}
If you don’t have an account, first you need to set up your account then you can generate the API key. [Create an account here.](https://laigo.ai/setup-your-account/)
{% endhint %}

3. After you have generated your API key, then you can use smartReceipt in any popular programming language, where you can find the code snippets [here](https://laigo.ai/smartclassify/).
4. Run your code. You will receive a JSON response with the invoice details.

### Credits (Laigo)

The calculation of processing a page:

| Page | Laigos |
| ---- | ------ |
| 1    | 1      |

###


# smartTableExtraction

Unlock the potential of data within documents with our AI-driven Table Extraction solution. Using state-of-the-art artificial intelligence models, our system effortlessly identifies and extracts tables from a wide range of documents, be it reports, invoices, or research papers.

This innovative technology not only saves you valuable time and effort but also ensures unparalleled accuracy in data extraction. Whether you're in finance, research, or any industry reliant on structured information, our Smart Table Extraction solution empowers you to harness data effectively, improving decision-making, and productivity while reducing manual data entry errors.

### Limitations

Max File Size is **10 MB**\
Max requests per second: **1**\
Processing Time: **Up to the number of characters in an image**

### Licenses

All rights reserved by Laigo

### API Call<br>

## Upload file to smartInvoice

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/smartTableExtraction`

#### Query Parameters

| Name          | Type   | Description                                                   |
| ------------- | ------ | ------------------------------------------------------------- |
| threshold     | String | Set minimum probability to be reached by model                |
| email         | String | Define receiver email address                                 |
| outputFormats | String | Define output format(s) like CSV.                             |
| languageHint  | String | Define language of the file content with ISO code (ISO-639-1) |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Returns Job Id" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}
{% endtabs %}

### Code snippets

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

```markup
curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartTableExtraction" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=CSV" \
     -F "languageHint=EN" \
     -F "file=@my-file-location-here"
```

{% endtab %}

{% tab title="C#" %}

```csharp
string baseUrl = "https://use.laigo.io/api/FileUpload/v1/Upload/smartTableExtraction";
string email = "my-email-here";
string outputFormats = "CSV";
string languageHint = "EN";
string token = "Bearer my-accessToken-here";

using (HttpClient client = new HttpClient())
{
 string url = $"{baseUrl}?email={email}&outputFormats={outputFormats}&languageHint={languageHint}";
 var request = new HttpRequestMessage(HttpMethod.Post, url);
 request.Headers.Add("Authorization", token);
 var content = new MultipartFormDataContent();
 content.Add(new StreamContent(File.OpenRead("/my-file-location-here")), "file", "/my-file-location-here");
 request.Content = content;
 var response = await client.SendAsync(request);
 response.EnsureSuccessStatusCode();
 Console.WriteLine(await response.Content.ReadAsStringAsync());
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartTableExtraction"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}
data = {
    "email": "my-email-here",
    "outputFormats": "CSV",
    "languageHint": "EN"
}
files = {
    "file": open("my-file-location-here", "rb")
}
response = requests.post(url, headers=headers, data=data, files=files)
response.raise_for_status()
print(response.text)
```

{% endtab %}

{% tab title="HTML & JavaScript" %}

```html
//note that running this code directly from the local file system might not work due to security restrictions.
<input type="file" id="fileInput">
<button id="uploadButton">Upload</button>

<script>
  document.getElementById('uploadButton').addEventListener('click', () => {
    const url = 'https://use.laigo.io/api/FileUpload/v1/Upload/smartTableExtraction';
    const token = 'Bearer my-email-here';

    const email = 'my-email-here';
    const outputFormats = 'CSV';
    const languageHint = 'EN';

    const fileInput = document.getElementById('fileInput');
    const file = fileInput.files[0];

    const formData = new FormData();
    formData.append('email', email);
    formData.append('outputFormats', outputFormats);
    formData.append('languageHint', languageHint);
    formData.append('file', file);

    const xhr = new XMLHttpRequest();
    xhr.open('POST', url);
    xhr.setRequestHeader('Authorization', token);

    xhr.onload = () => {
      if (xhr.status === 200) {
        console.log(xhr.responseText);
      } else {
        console.error('Request failed:', xhr.statusText);
      }
    };

    xhr.onerror = () => {
      console.error('Request failed');
    };

    xhr.send(formData);
  });
</script>
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();

$url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartTableExtraction";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$fields = array(
    "email" => "my-email-here",
    "outputFormats" => "CSV",
    "languageHint" => "EN",
    "file" => "@my-file-location-here"
);

curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    echo "Error: " . curl_error($curl);
}

curl_close($curl);

echo $response;
?>
```

{% endtab %}
{% endtabs %}

### Example (Step by step)

1. First you need to have a document sample that you want to use with smartTableExtraction. It can be any document type such as: invoice, receipt, letter, email etc.&#x20;
2. Inorder to use our smartTableExtractiontool you need to have an API key which can be generated from [here](https://laigo.ai/make-your-first-request/).&#x20;
3.

```
<figure><img src="/files/WBjhvUgAGQxP3IQrd8Be" alt=""><figcaption></figcaption></figure>
```

{% hint style="info" %}
If you don’t have an account, first you need to set up your account then you can generate the API key. [Create an account here.](https://laigo.ai/setup-your-account/)
{% endhint %}

3. After you have generated your API key, then you can use smartTableExtractionany popular programming language, where you can find the code snippets [here](https://laigo.ai/smartclassify/).
4. Run your code. You will receive a JSON ID as response.

### Credits (Laigo)

The calculation of processing a page:

| Page | Laigos |
| ---- | ------ |
| 1    | 1      |

###


# smartPaperFlow

Introducing our smartPaperFlow, which automates the task of splitting the documents between lot of joined pages within a big document, providing users with a more efficient and accurate way to process documents. Our model is capable of handling any document type, and provides extracted documents with their exact location where they begin and end. This means that you can save time and reduce the risk of errors that can occur with manual processing.

By utilizing our AI solution, you can experience faster and more accurate processing of documents, freeing up valuable time and resources that can be used elsewhere. With our model, we offer a valuable tool for anyone who regularly works with document processing, providing a more streamlined and effective solution for the Page Stream Segmentation problem. Try our smartPaperFlow solution for this problem today and see how it can help improve your document processing efficiency and accuracy.

### Limitations

Max File Size is **10 MB**\
Max requests per second: **1**\
Processing Time: **Up to the number of characters in an image**

### Licenses

All rights reserved by Laigo

### API Call<br>

## Upload file to smartInvoice

<mark style="color:green;">`POST`</mark> `https://use.laigo.io/api/FileUpload/v1/Upload/`smartPaperFlow

#### Query Parameters

| Name      | Type   | Description                                    |
| --------- | ------ | ---------------------------------------------- |
| threshold | String | Set minimum probability to be reached by model |
| email     | String | Define receiver email address                  |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

#### Request Body

| Name                                   | Type   | Description            |
| -------------------------------------- | ------ | ---------------------- |
| file<mark style="color:red;">\*</mark> | String | The file for uploading |

{% tabs %}
{% tab title="201: Created Returns Job Id" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}
{% endtabs %}

### Code snippets

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

```markup
curl -X POST "https://use.laigo.io/api/FileUpload/v1/Upload/smartPaperFlow" \
     -H "Authorization: Bearer my-accessToken-here" \
     -F "email=my-email-here" \
     -F "outputFormats=JSON" \
     -F "file=@my-file-location-here"
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new HttpClient();

var email = "my-email-here";
var outputFormats = "JSON";

var url = $"https://use.laigo.io/api/FileUpload/v1/Upload/smartDocSplit?email={Uri.EscapeDataString(email)}&outputFormats={Uri.EscapeDataString(outputFormats)}";

var request = new HttpRequestMessage(HttpMethod.Post, url);
request.Headers.Add("Authorization", "Bearer my-accessToken-here");
var content = new MultipartFormDataContent();
content.Add(new StreamContent(File.OpenRead("my-file-location-here")), "file", "my-file-location-here");
request.Content = content;

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartDocSplit"
headers = {
    "Authorization": "Bearer my-accessToken-here"
}

files = {
    "email": (None, "my-email-here"),
    "outputFormats": (None, "JSON"),
    "file": ("sample.pdf", open("my-file-location-here", "rb"))
}

response = requests.post(url, headers=headers, files=files)
print(response.text)
```

{% endtab %}

{% tab title="HTML & JavaScript" %}

```html
<input type="file" id="fileInput">
<button onclick="uploadFile()">Upload</button>
<script>
    function uploadFile() {
        var fileInput = document.getElementById('fileInput');
        var file = fileInput.files[0];
        var formData = new FormData();

        formData.append("email", "my-email-here");
        formData.append("outputFormats", "JSON");
        formData.append("file", file);

        var xhr = new XMLHttpRequest();
        xhr.withCredentials = true;

        xhr.onreadystatechange = function() {
            if (xhr.readyState === 4) {
                if (xhr.status === 200) {
                    console.log(xhr.responseText);
                } else {
                    console.error("Error:", xhr.statusText);
                }
            }
        };

        xhr.open("POST", "https://use.laigo.io/api/FileUpload/v1/Upload/smartDocSplit");
        xhr.setRequestHeader("Authorization", "Bearer my-accessToken-here");
        xhr.send(formData);
    }
</script>
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();

$url = "https://use.laigo.io/api/FileUpload/v1/Upload/smartDocSplit";
$headers = array(
    "Authorization: Bearer my-accessToken-here"
);

$data = array(
    "email" => "my-email-here",
    "outputFormats" => "JSON",
    "file" => new CurlFile("my-file-location-here", "application/pdf", "sample.pdf")
);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if ($response === false) {
    echo 'Curl error: ' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Example (Step by step)

1. First you need to have a document sample that you want to use with smartPaperFlow. It can be any document type such as: invoice, receipt, letter, email etc. For e.g you can use the receipt below:

<figure><img src="/files/VJXt2kFsUl0dSjW0T5sl" alt=""><figcaption></figcaption></figure>

2. Inorder to use our smartPaperFlow tool you need to have an API key which can be generated from [here](https://laigo.ai/make-your-first-request/).&#x20;

{% hint style="info" %}
If you don’t have an account, first you need to set up your account then you can generate the API key. [Create an account here.](https://laigo.ai/setup-your-account/)
{% endhint %}

3. After you have generated your API key, then you can use smartPaperFlow any popular programming language, where you can find the code snippets [here](https://laigo.ai/smartclassify/).
4. Run your code. You will receive a JSON response with the invoice details.

### Credits (Laigo)

The calculation of processing a page:

| Page | Laigos |
| ---- | ------ |
| 1    | 1      |

###


# Results

### Json Result

If you want to have to request the extracted text in a JSON, you can request the following API route.

<mark style="color:blue;">`GET`</mark> `https://use.laigo.io/api/Result/v1/JobResults/<jobid>/json`

#### Query Parameters

| Name                                    | Type   | Description                            |
| --------------------------------------- | ------ | -------------------------------------- |
| jobId<mark style="color:red;">\*</mark> | String | Job Id from uploaded file to smartTool |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

{% tabs %}
{% tab title="200: OK Returns json result" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}

{% tab title="404: Not Found Required file is not found" %}

{% endtab %}
{% endtabs %}

### Zip Result

If you want to get the result as files (searchable PDF + Textfile), you can request the following API route.

<mark style="color:blue;">`GET`</mark> `https://use.laigo.io/api/Result/v1/JobResults/<jobid>/zip`

#### Query Parameters

| Name                                    | Type   | Description                            |
| --------------------------------------- | ------ | -------------------------------------- |
| jobId<mark style="color:red;">\*</mark> | String | Job Id from uploaded file to smartTool |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

{% tabs %}
{% tab title="200: OK Returns zip file as a result" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}

{% tab title="404: Not Found Required file is not found" %}

{% endtab %}
{% endtabs %}

### File Result

If you want to get the result as file (CSV), you can request the following API route.

<mark style="color:blue;">`GET`</mark> `https://use.laigo.io/api/Result/v1/JobResults/<jobid>/file`

#### Query Parameters

| Name                                         | Type   | Description                            |
| -------------------------------------------- | ------ | -------------------------------------- |
| jobId<mark style="color:red;">\*</mark>      | String | Job Id from uploaded file to smartTool |
| outputType<mark style="color:red;">\*</mark> | String | Requested file type                    |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

{% tabs %}
{% tab title="200: OK Returns csv file as a result" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}

{% tab title="404: Not Found Required file is not found" %}

{% endtab %}
{% endtabs %}


# Delete

If you want to delete your job you need to execue the following API.

<mark style="color:red;">`DELETE`</mark> `https://use.laigo.io/api/FileUpload/v1/DeleteByJobId`

#### Query Parameters

| Name                                    | Type   | Description                                 |
| --------------------------------------- | ------ | ------------------------------------------- |
| jobId<mark style="color:red;">\*</mark> | String | job id that you get from File Upload result |

#### Headers

| Name                                          | Type   | Description                                                      |
| --------------------------------------------- | ------ | ---------------------------------------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | A JWT issued to your application by the Laigo identity provider. |

{% tabs %}
{% tab title="200: OK Successful operation" %}

{% endtab %}

{% tab title="400: Bad Request Incomplete request or insufficient Laigos" %}

{% endtab %}

{% tab title="401: Unauthorized Unauthorized call" %}

{% endtab %}

{% tab title="404: Not Found Required file is not found" %}

{% endtab %}
{% endtabs %}


# Laigo Postman

Introducing Our Postman API Collection: Test APIs Seamlessly on Our Platform!

We are excited to introduce our innovative Postman API Collection that empowers you to interact directly with a range of APIs through our user-friendly platform. Whether you're a developer, a QA tester, or simply someone curious about how APIs work, our collection provides a seamless and efficient way to test API endpoints without the need for complex setups or additional tools.

### What is the Postman API Collection?

At its core, the Postman API Collection is a curated selection of API endpoints that are commonly used in various applications. These endpoints span different domains, from social media integrations to payment gateways and everything in between. Instead of requiring you to set up each API individually or rely on external applications, we've gathered them all in one place for your convenience.

### Key Features:

1. **Easy Accessibility**: Our platform grants you direct access to the APIs through a user-friendly interface. No need to switch between different applications or tools – you can test the APIs right here.
2. **Diverse Use Cases**: Whether you're interested in exploring how data is fetched from a weather API or how authentication works on a financial API, our collection covers a broad spectrum of use cases.
3. **Instant Feedback**: As you interact with the APIs, you'll receive real-time feedback on your requests. This can be invaluable for developers fine-tuning their code or testers verifying the behavior of an application.
4. **No Setup Required**: Forget about dealing with API keys, environment variables, or complicated configurations. Our platform abstracts these technicalities, enabling you to dive straight into testing.
5. **Educational Resource**: For those new to APIs, our collection serves as an educational tool. Each endpoint comes with documentation and explanations, helping you understand the purpose and functionality of different API calls.

### How to Get Started:

1. **Sign Up or Log In**: If you haven't already, create an account on our platform or log in to your existing one.
2. **Browse the Collection**: Navigate through our API Collection via the following URL: [Postman API Collection](https://www.postman.com/laigo-gmbh/workspace/laigo-smarttools-api). This link will take you to the collection where you can find endpoints that align with your interests or testing needs.
3. **Make Requests**: Once you've selected an API, you can begin making requests using the provided parameters. Our intuitive interface makes it easy to input data and customize your requests.
4. **View Responses**: As you send requests, you'll receive responses from the APIs. These responses will give you insights into the data returned by the endpoints.
5. **Learn and Experiment**: Feel free to experiment with different endpoints and request variations. Our platform encourages exploration and learning.

We're thrilled to offer this hands-on experience with APIs through our Postman API Collection. Whether you're a seasoned developer or someone looking to expand your technical knowledge, our platform has something to offer. So why wait? Dive into the world of APIs with us today!

<br>


# Laigo SDK

Introducing the Laigo SDK for Seamless API Access via NuGet Gallery!

We are thrilled to present the Laigo SDK, a powerful tool designed to streamline your API access experience. With the Laigo SDK, integrating our services into your projects has never been easier. Say goodbye to manual configurations and complex setups – our SDK empowers you to effortlessly incorporate our APIs into your applications.

**Why Choose the Laigo SDK?** Gone are the days of struggling with convoluted API integration processes. The Laigo SDK simplifies this journey by offering a straightforward and user-friendly approach to accessing our services. No more deciphering intricate documentation or battling compatibility issues; our SDK takes care of the technical intricacies, leaving you with more time to focus on your project's core functionality.

**How to Access the Laigo SDK** To get started with the Laigo SDK, simply head over to the NuGet Gallery. We've made the SDK readily available for your convenience:

* For projects targeting .NET Framework 4.8, grab the Laigo SDK package from this link: <https://www.nuget.org/packages/Laigo.SDK.Net48>
* For projects on the latest platforms, you can find the Laigo SDK package here: <https://www.nuget.org/packages/Laigo.SDK>

**How It Works** Once you've incorporated the Laigo SDK into your project, the door to seamless API access swings wide open. Our SDK handles the intricacies of authentication, request handling, and response parsing, allowing you to interact with our APIs in a clean and intuitive manner.

**Getting Started**

1. Choose the appropriate package link based on your project's .NET framework version.
2. Install the Laigo SDK package using NuGet Package Manager or your preferred package management method.
3. Utilize the provided API client classes and methods to easily integrate our services into your application.
4. Enjoy hassle-free API access and concentrate on delivering value to your users.

**Stay Connected** We're committed to continuously enhancing your experience with the Laigo SDK. Keep an eye out for updates and improvements, as we strive to make API integration even smoother and more efficient for you.

Seize the opportunity to simplify your API access journey with the Laigo SDK. Visit the NuGet Gallery links above and take your project's functionality to the next level. If you encounter any questions or need assistance, don't hesitate to reach out to our support team – we're here to help you every step of the way!


# Accounting

In Accounting, there is a significant volume of paper documents that need to be processed and stored, including invoices, delivery notes, and receipts.

\
However, not all suppliers have adopted digital processes, which results in a high volume of paper that needs to be scanned, checked, and imported into systems such as DATEV or SAP in a structured manner. This manual process is time-consuming and can take up to 5 minutes per page.

SmartICR offers a solution to this issue by providing a layer to scanned documents that enables them to be stored as searchable and editable PDF-A files. With SmartICR, users can search for specific documents, mark and copy text, and extract important data automatically, eliminating the need for manual data entry and reducing the risk of typos.

### Use-Case 1: Searchable Document Archive

Imagine trying to locate an invoice from years ago, but not being able to search for it as the invoices are stored as scanned images without searchable text. With SmartICR, users can search for invoices using keywords and retrieve the necessary information, such as the supplier’s name, quickly and easily.

### Use-Case 2: Automated Invoice Data Extraction

SmartICR eliminates the need for manual data entry by automatically extracting important information from invoices, such as the receiver’s name and address, sender’s name and address, invoice date and number, sender’s IBAN and BIC, and sender’s tax ID. This streamlines the accounting process and reduces the risk of typos, saving users time and increasing efficiency.

### Use-Case 3: Automated Receipt Data Extraction

SmartICR also offers automated receipt data extraction, providing users with the same important information as invoices, such as the receiver’s name and address, sender’s name and address, receipt date and number, sender’s IBAN and BIC, and sender’s tax ID. This eliminates the need for manual data entry, reducing the risk of typos, and increasing efficiency.

### Conclusion

In conclusion, smartICR is a valuable tool for accounting departments, as it streamlines the process of scanning, archiving, and extracting data from paper-based documentation, saving time and effort and reducing the risk of errors.


# Insurances

In the insurance industry, a significant amount of paper documentation is commonly encountered, including contracts, personal data, and certificates.\
To streamline the processes and enhance efficiency, advanced technologies such as Natural Language Processing (NLP), Computer Vision (CV), and machine learning algorithms can be utilized.

### Use-Case 1: Claims Processing

The use of NLP enables the efficient extraction of relevant information from insurance claims, including policy numbers and claim amounts. This reduces the time and effort required for manual processing.

Claims can be automatically classified based on their type, such as auto, home, or health insurance, for proper routing to the appropriate department for processing.

CV algorithms can be utilized to review and verify images and videos of damaged property or vehicles, further reducing the time and effort required for manual processing.

NLP algorithms can also be utilized to summarize long claims documents, making it easier for claims adjusters to understand the key details of each claim.

### Use-Case 2: Fraud Detection

Named entities in customer communications, such as names of individuals and organizations, can be identified through NLP, to detect potential fraudsters.

Claims and customer communications can also be classified as either legitimate or fraudulent, using NLP algorithms.

### Use-Case 3: Policy Analysis

NLP algorithms can analyze policy documents, extract key information, and assist in policy analysis and decision-making.

Policy documents can also be summarized, to understand the key details of each policy. Policies can also be classified based on their type, to assist with policy analysis and management.

### Use-Case 4: Sales and Marketing

NLP algorithms can analyze customer data to predict customer behavior and target marketing efforts more effectively.

Customer communications, such as emails and chat messages, can be analyzed using NLP to understand customer sentiment toward insurance products and services, and to improve sales and marketing efforts.

### Conclusion

In conclusion, the integration of such as NLP and CV can greatly enhance the efficiency of various processes in the insurance industry, ranging from claims processing to policy analysis and marketing efforts.


# HR & Recruitment

Human Resources & Recruitment is a critical function within any organization, with a primary responsibility of attracting, hiring and retaining top talent.\
\
One of the challenges faced in this domain is the overwhelming amount of paper-based information that comes in the form of Curriculum Vitae (CVs), certificates, and personal documents.\
This creates a problem of efficiently extracting the data in a structured manner, summarizing the text, and digitalizing the information.

To address this challenge, technology has come to the aid of HR & Recruitment professionals by offering innovative solutions that streamline their processes.\
\
Two such solutions are Keyword Extraction and Resume Screening, both utilizing Natural Language Processing (NLP) techniques.

### Use Case 1: Keywords Extraction

Keywords Extraction involves the extraction of relevant keywords from resumes, allowing HR and recruitment professionals to identify the most crucial skills and qualifications of a candidate. This process can save a significant amount of time and improve the accuracy of the results, as opposed to a manual review of each CV. With the help of NLP techniques, this process can be performed automatically, reducing the workload of HR and recruitment professionals.

### Use-Case 2: Resume Screening

Resume Screening involves automatically filtering out unqualified candidates, saving HR and recruitment professionals valuable time and resources. By leveraging NLP techniques such as Text Classification, this process can quickly identify the most suitable candidates based on the required qualifications and skills, enabling HR and recruitment professionals to focus their efforts on engaging with the most promising candidates.

### Conclusion

By utilizing these innovative technologies like Keyword Extraction and Resume Screening, HR and recruitment professionals can save time, reduce workload, and improve the accuracy and efficiency of their processes, allowing them to focus on the core aspects of their role.


# Legal

The legal industry is known for its vast and complex nature, with a significant amount of paper-based information being generated daily, such as contracts and personal data. This information overload creates a challenge for legal professionals to effectively manage, analyze and retrieve the necessary information.

To address these challenges, three such solutions are Document Classification, Contract Summarization, and Legal Information Retrieval.

### Use-Case 1: Document Classificaion

Document Classification involves the automatic categorization of legal documents, such as contracts and legal agreements, based on their content and type. This process can save a significant amount of time and improve the accuracy of the results, as opposed to manual categorization.\
For example, a legal document may be classified as a contract, lease agreement or power of attorney, based on its content and type.

### Use-Case 2: Contract Summarization

Contract Summarization involves the automatic summarization of contracts, providing a concise overview of the contract terms and provisions. This can be especially useful for legal professionals who need to quickly understand the main provisions of a contract without having to read through the entire document.\
For example, a contract summarization may highlight the key terms and conditions, such as the duration, obligations, and termination clauses.

### Use-Case 3: Legal Information Retrieval

Legal Information Retrieval involves the extraction of important information for legal research and analysis. This process can be performed automatically using NLP techniques, to extract relevant information from legal documents, such as dates, parties, and obligations. This information can then be used to perform legal research and analysis, saving legal professionals valuable time and resources.

### Conclusion

By utilizing these solutions, legal professionals can save time, reduce workload, and improve the accuracy and efficiency of their processes, allowing them to focus on the core aspects of their roles. The implementation of these solutions can lead to increased productivity, cost savings, and improved decision-making for organizations.


# Finance

The finance industry is known for its fast-paced and data-intensive nature, with a vast amount of paper-based information being generated daily, such as invoices, delivery notes, receipts, bank account sheets, contracts, personal data, certificates, and more.\
\
Managing this information in a structured and efficient manner is a challenge that finance professionals face on a daily basis.

To address these challenges, our  solutions are Fraud Detection, Loan Processing, Financial Information Retrieval, and Financial Document Classification.

### Use-Case 1: Fraud Detection

Fraud Detection involves the automatic detection of potential fraud in banking transactions and communications, improving the security of financial data and transactions. Fraud detection algorithms can analyze vast amounts of transaction data to identify unusual or suspicious activity, reducing the risk of fraud and improving the security of financial data.\
For example, a fraud detection algorithm may flag a transaction that is larger than normal or a transaction that is made from a different location than normal.

### Use-Case 2: Loan Processing

Loan Processing involves the analysis of loan applications and credit reports, providing insights into credit risk and helping to make informed lending decisions. NLP algorithms can analyze vast amounts of loan application data, providing insights into the creditworthiness of applicants and helping to minimize the risk of loan defaults.\
For example, a loan processing algorithm may analyze the credit history, income, and employment status of an applicant to determine their credit risk.

### Use-Case 3: Financial Information Retrieval

Financial Information Retrieval – involves the extraction of relevant entities from financial documents, such as the date, location, and details of the parties involved. This information can be extracted automatically using NLP techniques, such as Named Entity Recognition (NER), to extract relevant information from financial documents, such as loan agreements and bank account statements.\
For example, NER algorithms may extract the date, location, and names of the parties involved in a loan agreement.

### Use-Case 4: Financial Document Classification

Financial Document Classification involves the automatic categorization of financial documents, such as bank account statements and loan agreements, based on their content and type. This process can save a significant amount of time and improve the accuracy of the results, as opposed to manual categorization.\
For example, a financial document may be classified as a bank statement, loan agreement, or receipt, based on its content and type.

### Conclusion

By utilizing these solutions, finance professionals can save time, reduce workload, and improve the accuracy and efficiency of their processes, allowing them to focus on the core aspects of their roles. The implementation of these solutions can lead to increased productivity, cost savings, and improved decision-making for organizations.


# Customer Service

Customer Service is an essential aspect of any business that interacts with its customers. The main goal of customer service is to provide prompt, efficient, and satisfactory support to customers to resolve their issues and concerns. In this context, it is not uncommon to receive a vast amount of paper-based forms and tickets from customers seeking support.

To effectively manage this influx of information and prioritize support requests, businesses can utilize the following use cases that demonstrate the power of categorizing support tickets and analyzing customer feedback:

### Use-Case 1: Categorizing Support Tickets

The categorization of support tickets plays a crucial role in ensuring that customer service teams are able to quickly identify and prioritize incoming tickets. By categorizing tickets into different buckets, such as billing, technical issues, account management, and product feedback, customer service teams can ensure that each ticket is assigned to the right person and resolved in a timely manner.\
For example, if a customer reports a technical issue with a product, it would be assigned to a technical support team, while billing issues would be assigned to a billing team. This approach helps streamline the support process and reduces resolution time.

### Use-Case 2: Analyze Customer Feedback

Another important use case for customer service is the analysis of customer feedback. This includes the analysis of both positive and negative feedback. By analyzing customer feedback, businesses can gain valuable insights into their products and services and identify areas where they need to improve. For example, if a large number of customers report a specific technical issue, the business can use this feedback to identify and resolve the underlying problem, leading to improved customer satisfaction.

### Use-Case 3: Categorize Service Requests

In addition to categorizing support tickets, businesses can also classify incoming service requests by work type, region, or urgency. This helps customer service teams allocate resources efficiently and resolve customer issues in a timely manner.\
For example, if a customer requests an urgent repair, it would be assigned a higher priority than a routine service request. This ensures that customers receive the support they need when they need it.

### Conclusion

In conclusion, categorizing support tickets and analyzing customer feedback are essential aspects of effective customer service. By streamlining the support process and gaining valuable insights into customer needs and preferences, businesses can ensure they provide the best possible customer experience.


# My Account

From your settings dashboard, you can edit your profile information, reset password, enable Two-factor Authentification and see history of logged in time and devices.

1\. To access the settings dashboard click on **My Account** on the top right sidebar.

<figure><img src="/files/cXi31PkIVLkQlsCNngHN" alt=""><figcaption></figcaption></figure>

2\. From the dropdown menu you’ll have Settings and once you can access it from there

3.You’ll land on the settings dashboard

**Account settings**

On the settings page you have two sections for Keycloak account management.

1\. If you select **Personal info** then you can edit perosnal information regarding your account, such as email, Name, Language.

<figure><img src="/files/TFishVdVZXC5HtE1AVyD" alt=""><figcaption></figcaption></figure>

2\. If you select **Account Security** you will have 3 sections from the left sidebar which are:\
Signing-in, Device activity, Linked accounts.

If you select the **Signing-in** page then you have the option for resetting your password and also enabling and managing Two-factor authentication.

<figure><img src="/files/tUimurse7Pe08sOrVvEw" alt=""><figcaption></figcaption></figure>

You have also **Device activity** page, where it shows information regarding your logging-in activity and which devices you have used.

<figure><img src="/files/7EYS5oD8emNSbsQb2Rpp" alt=""><figcaption></figcaption></figure>

On the **Linked accounts** page, you can manage logins through third-party accounts, where you can setup Github, Discord, etc.

<figure><img src="/files/5Uf3ccFNPq2EwxNxvXYW" alt=""><figcaption></figcaption></figure>


