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.

  2. For creating the token, please visit our platform and go to API-Client Page to create and copy your client credentials.

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

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

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


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

Query Parameters

NameTypeDescription

client_id*

String

The ClientId that has been generated for this function.

client_secret*

String

The ClientSecret that has been generated for this function.

grant_type*

String

Here you put your client credentials


Get your sample code

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"

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

POST https://use.laigo.io/api/FileUpload/v1/Upload/smartICR

Query Parameters

NameTypeDescription

email*

String

If you want to sent the result to your email, you can define the destination email with this parameter

outputFormats*

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

NameTypeDescription

accessToken*

String

A JWT issued to your application by the Laigo identity provider.

Request Body

NameTypeDescription

file*

String

The file for uploading

Last updated