Laigo GmbH

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.
2. For creating the token, please visit our platform and go to API-Client Page to create and copy your client credentials.

2. 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.

3. For generating your client_id and client_secret you can click on the button ‘Request new’ then you can have your credentials that you can use for creating a token.

4. 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.

*the route for generating the tokens is not working at the moment, because the work at test server is still going on

Create an access token using GET

				
					https://account.laigo.io/realms/SmartTools/protocol/openid-connect/token
				
			

Get your sample code

Parameters Description
client_id
The ClientId that has been generated for this function.
client_secret
The ClientSecret that has been generated for this function.
grant_type
Here you put your client credentials

Expected response

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

				
			

HTTP Status Codes

Status code Message
200
OK
202
Accepted
400
Bad Request
401
Unauthorized
404
Not Found

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.

POST

				
					https://use.laigo.io/api/FileUpload/v1/Upload/smartICR
				
			
Parameters Description
accessToken
A JWT issued to your application by the Laigo identity provider.
file
The file for uploading
email
If you want to sent the result to your email, you can define the destination email with this parameter
outputFormats
As output format you can choose PDF and/ TEXT (e.g. outputFormats=PDF,TEXT)
languageHint
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

Once the input file is send to the API, the file will be send to the OCR. After processing you will receive a searchable PDF and/or a textfile with the extracted text included.

Example Response

The result is the jobid, you can use later for getting the result.

"754a9eff-2633-47d6-ab10-f6b18da1da4f"

Get a result as JSON

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

GET

				
					https://use.laigo.io/api/Result/v1/JobResults/<jobid>/json
				
			
Parameters Description
accessToken
A JWT issued to your application by the Laigo identity provider.
fileName
The path to the image file to use as input.

Example response

				
					{ 
    "files":  [
        { 
            "inputFileName": "test.pdf",
            "size": 59472, "pageCount": 1, 
            "content": "Hello World!"
        } 
    ]
}
				
			

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

GET

				
					 https://use.laigo.io/api/Result/v1/JobResults/<jobid>/zip
				
			
Parameters Description
accessToken
A JWT issued to your application by the Laigo identity provider.
jobID
This is the jobid you get as response after uploading a file.

Example Response (ZIP):
filebytes

Status code Message
200
OK
202
Accepted
400
Bad Request
401
Unauthorized
404
Not Found

While using smartICR API there could be some error messages, that are done for file validation checking:

Error Message Description
Result not available any more.
Outcome information no longer accessible.
Result not yet available, please try again later.
Outcome data currently unavailable, kindly retry at a later time.
No valid input formats chosen for this SmartTool
No suitable input formats selected for this SmartTool.
Model does not support Language Hint
Language hint feature not supported by the model.
You need to accept the newsletter in order to use this API
Newsletter acceptance required for API usage.
You ran out of Laigos...
You've depleted your Laigos supply.
Please send the correct input file format!
The file format is not (PNG,JPG) or (PDF)
Please send a file that doesn’t exceed the size limit!
The file size is more than the allowed limit (number)
Please make sure that your file doesn’t contain any suspicious malware data!
The file contains suspicious data, then security check system warns you

Setup Your Adapters

On the left sidebar you have section for setting up your Adapters. You have different adapters such as: IMAP, WebDev or even you can also configure your own adapter through the dashboard functionalities.

WHAT’S NEXT:

Table of Contents

Let’s go!

[miniorange_social_login]
[miniorange_social_login]

Let’s go!

[miniorange_social_login]

Let’s go!

Let’s go!

[miniorange_social_login]