NAV
Ruby Python JavaScript Java Go Swift PHP C# C

Lazarus Forms API v1.7.2

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Welcome to the documentation for the Lazarus Forms API.

Using this API, you can convert unstructured data, like PDF forms, into structured jsons. This enables that data to be used in a wide variety of ways, which would previously be difficult to do without a team of data entry people.

Below, you'll find how to make a request to the APIs currently available and a comprehensive guide to the schema of the response.

To your right, you'll find code examples in a variety of languages to help you get started.

The form tool is able to work regardless of form type and should be fit for most use cases. It also works well regardless of orientation of pages, can detect and convert handwriting, and detect urgency in documents. Despite this it does have some limitations. The form tool at this time cannot convert two forms sent together as a pdf into two separate outputs. It also cannot work with non-latin characters at this moment (however there are preview builds that can). Although the form tool is reliable, it should not yet be trusted as the only decision maker in high risk scenarios (i.e. determining what medications to provide to an ICU patient based on the outputs of the form tool). Please make sure to have a human in the loop whenever possible.

Base URLs

Authentication

API Reference

Forms

Upload a file via multipart-form, get back a JSON

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('path_to_file')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/generic"

payload={}

files=[
  ('file',('file_name',open('path_to_file','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');

var formdata = new FormData();
formdata.append("file", 'path_to_file', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('path_to_file')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open(path_to_file)
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base(path_to_file))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": path_to_file,
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('path_to_file')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/generic", Method.Post);
                request.Timeout = -1;
                request.AddHeader("Content-Type", "multipart/form-data");
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                request.AddFile("file", "PathToFile");
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/generic

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--form 'file=@path_to_file'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

file: path_to_file

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

{
  "documentId": "string",
  "entitiesExtracted": [
    {
      "boundingRegions": [
        {
          "boundingBox": [
            0
          ],
          "pageNumber": 0
        }
      ],
      "category": "string",
      "confidence": 0,
      "content": "string",
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ],
      "subCategory": "string"
    }
  ],
  "isUrgent": true,
  "keyValuePairs": [
    {
      "confidence": 0,
      "key": {
        "boundingRegions": [
          {
            "boundingBox": [
              0
            ],
            "pageNumber": 0
          }
        ],
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      },
      "value": {
        "boundingRegions": [
          {
            "boundingBox": [
              0
            ],
            "pageNumber": 0
          }
        ],
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    }
  ],
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "rawText": "string",
  "requestDateTime": "string",
  "status": "SUCCESS",
  "tablesExtracted": [
    {
      "boundingRegions": [
        {
          "boundingBox": [
            0
          ],
          "pageNumber": 0
        }
      ],
      "cells": [
        []
      ],
      "columnCount": 0,
      "rowCount": 0,
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ]
    }
  ]
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic"

payload = json.dumps({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/generic", Method.Post);
                request.Timeout = -1;
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                var body = @"{""inputUrl"":""https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"",""fileId"":""abc"",""metadata"":{},""webhook"":""google.com""}";
                request.AddParameter("application/json", body,  ParameterType.RequestBody);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf, 
  "fileId": abc,
  "metadata": {},
  "webhook": google.com
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
  "documentId": "string",
  "entitiesExtracted": [
    {
      "boundingRegions": [
        {
          "boundingBox": [
            0
          ],
          "pageNumber": 0
        }
      ],
      "category": "string",
      "confidence": 0,
      "content": "string",
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ],
      "subCategory": "string"
    }
  ],
  "isUrgent": true,
  "keyValuePairs": [
    {
      "confidence": 0,
      "key": {
        "boundingRegions": [
          {
            "boundingBox": [
              0
            ],
            "pageNumber": 0
          }
        ],
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      },
      "value": {
        "boundingRegions": [
          {
            "boundingBox": [
              0
            ],
            "pageNumber": 0
          }
        ],
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    }
  ],
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "rawText": "string",
  "requestDateTime": "string",
  "status": "SUCCESS",
  "tablesExtracted": [
    {
      "boundingRegions": [
        {
          "boundingBox": [
            0
          ],
          "pageNumber": 0
        }
      ],
      "cells": [
        []
      ],
      "columnCount": 0,
      "rowCount": 0,
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ]
    }
  ]
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via base64, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "base64": "base64_string",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic"

payload = json.dumps({
  "base64": "base64_string",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "base64": "base64_string",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"base64\":\"base64_string\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic"
  method := "POST"

  payload := strings.NewReader(`{"base64": "base64_string", "fileId": "abc", "metadata": {}, "webhook": "google.com"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"base64\":\"base64_string\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"base64": "base64_string", "fileId": "abc", "metadata": {}, "webhook": "google.com"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/generic", Method.Post);
                request.Timeout = -1;
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                var body = @"{""base64"":""base64_string"",""fileId"":""abc"",""metadata"":{},""webhook"":""google.com""}";
                request.AddParameter("application/json", body,  ParameterType.RequestBody);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"base64\":\"base64_string\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"base64": "base64_string", "fileId": "abc", "metadata": {}, "webhook": "google.com"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "base64": base64_string, 
  "fileId": abc,
  "metadata": {},
  "webhook": google.com
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
base64 json string true Base64 to extract PDF from.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
  "documentId": "string",
  "entitiesExtracted": [
    {
      "boundingRegions": [
        {
          "boundingBox": [
            0
          ],
          "pageNumber": 0
        }
      ],
      "category": "string",
      "confidence": 0,
      "content": "string",
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ],
      "subCategory": "string"
    }
  ],
  "isUrgent": true,
  "keyValuePairs": [
    {
      "confidence": 0,
      "key": {
        "boundingRegions": [
          {
            "boundingBox": [
              0
            ],
            "pageNumber": 0
          }
        ],
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      },
      "value": {
        "boundingRegions": [
          {
            "boundingBox": [
              0
            ],
            "pageNumber": 0
          }
        ],
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    }
  ],
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "rawText": "string",
  "requestDateTime": "string",
  "status": "SUCCESS",
  "tablesExtracted": [
    {
      "boundingRegions": [
        {
          "boundingBox": [
            0
          ],
          "pageNumber": 0
        }
      ],
      "cells": [
        []
      ],
      "columnCount": 0,
      "rowCount": 0,
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ]
    }
  ]
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via multipart-form, get back a ZIP file

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic/zip")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('file_HERE')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/generic/zip"

payload={}

files=[
  ('file',('file_name',open('file_HERE','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');

var formdata = new FormData();
formdata.append("file", 'file_HERE', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic/zip", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('file_HERE')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic/zip")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic/zip"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("file_HERE")
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base("file_HERE"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": "file_HERE",
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic/zip',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLfile('file_HERE')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/generic/zip");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddFile("file", "file_HERE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic/zip");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/generic/zip

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--form 'file=@"file_HERE"'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

file: file_HERE

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

File Contents

File Description
.csv CSV containing a breakdown of the itemization
.json JSON file containing the entire JSON response
.txt TXT file containing the entire JSON response
file Your uploaded file

The default name for the files are an epoch timestamp if fileId is not supplied.

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation A Zip File
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a ZIP file

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic/zip")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic/zip"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic/zip", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic/zip")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic/zip"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic/zip',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/generic/zip");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("Content-Type", "application/json");
var body = @"{""inputUrl"":""inputUrl_HERE"",""fileId"":""fileId_HERE | Optional"",""metadata"":{""metadata_HERE | Optional""},""webhook"":""webhook_HERE | Optional""}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic/zip");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic/zip

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

File Contents

File Description
.csv CSV containing a breakdown of the itemization
.json JSON file containing the entire JSON response
.txt TXT file containing the entire JSON response
file Your uploaded file

The default name for the files are an epoch timestamp if fileId is not supplied.

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation A Zip File
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Async queue a URL via JSON, send a ZIP file to an output URL

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic/zip/async")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE", 
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional",
  "outputUrl": "outputUrl_HERE",
  "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"}
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic/zip/async"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE", 
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional",
  "outputUrl": "outputUrl_HERE",
  "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"}
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE", 
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional",
  "outputUrl": "outputUrl_HERE",
  "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"}
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic/zip/async", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\",\"outputUrl\":\"outputUrl_HERE\",\"outputUrlHeaders\":{\"outputUrlHeaders_HERE | Optional\"");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic/zip/async")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic/zip/async"
  method := "POST"

  payload := strings.NewReader(`{ "inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional", "outputUrl": "outputUrl_HERE", "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"} }`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\",\"outputUrl\":\"outputUrl_HERE\",\"outputUrlHeaders\":{\"outputUrlHeaders_HERE | Optional\""
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic/zip/async")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic/zip/async',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{ "inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional", "outputUrl": "outputUrl_HERE", "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"} }',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/generic/zip/async");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("Content-Type", "application/json");
var body = @"{ ""inputUrl"": ""inputUrl_HERE"", ""fileId"": ""fileId_HERE | Optional"", ""metadata"": {""metadata_HERE | Optional""}, ""webhook"": ""webhook_HERE | Optional"", ""outputUrl"": ""outputUrl_HERE"", ""outputUrlHeaders"": {""outputUrlHeaders_HERE | Optional""} }";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic/zip/async");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\",\"outputUrl\":\"outputUrl_HERE\",\"outputUrlHeaders\":{\"outputUrlHeaders_HERE | Optional\"";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic/zip/async

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic/zip/async' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": inputUrl_HERE, "fileId": fileId_HERE | Optional, "metadata": metadata_HERE | Optional, "webhook": webhook_HERE | Optional, "outputUrl": outputUrl_HERE, "outputUrlHeaders": outputUrlHeaders_HERE | Optional}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional,
  "outputUrl": outputUrl_HERE,
  "outputUrlHeaders": outputUrlHeaders_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
outputUrl json string true Url where to send output zip file. Must be open to PUT requests.
outputUrlHeaders json dict false Json with headers to be sent to your outputUrl.
webhook json string false Webhook to ping after API runs.

Example responses

202 Response

{
  "status": "RUNNING",
  "statusId": "string"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
202 RUNNING Accepted successful operation confirmationMessage
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage

Forms Version 2

This is a newer version of the Forms model that is currently opt-in.

Instructions:
1.Add the parameter key version to the headers of the POST request with the value 2 Please do note that there are changes to the response of the POST request.

Improvements:
-Regions for detected Text are now bounding regions rather than bounding boxes as before. This classifies text in a more specific shape/region.

Response Changes:
-The key boundingRegion previously in

body[ocrResults][readResults][index][lines][index][boundingRegion] is now gone and is now replaced with the key polygon.

-The key polygon which will contain points indicating the boundaries of the block of text.

Before:

body[ocrResults][readResults][index][lines][index][boundingRegion]

After:

body[ocrResults][readResults][index][lines][index][polygon]

Upload a file via multipart-form, get back a JSON

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["version"] = "2"
form_data = [['file', File.open('path_to_file')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/generic"

payload={}

files=[
  ('file',('file_name',open('path_to_file','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE',
  'version': '2'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');
myHeaders.append("version", '2');


var formdata = new FormData();
formdata.append("file", 'path_to_file', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('path_to_file')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .addHeader("version", '2')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open(path_to_file)
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base(path_to_file))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("version", "2")


  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": path_to_file,
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("2", forHTTPHeaderField: "version")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('path_to_file')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
    'version: 2'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/generic", Method.Post);
                request.Timeout = -1;
                request.AddHeader("Content-Type", "multipart/form-data");
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                request.AddHeader("version", 2);
                request.AddFile("file", "PathToFile");
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "version: 2");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/generic

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'version: 2' \
--form 'file=@path_to_file'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE
version: 2

Body Parameters

file: path_to_file

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

{
  "documentId": "string",
  "entitiesExtracted": [
    {
        "polygon": [
            0.805,
            1.0025,
        ]
      "category": "string",
      "confidence": 0,
      "content": "string",
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ],
      "subCategory": "string"
    }
  ],
  "isUrgent": true,
  "keyValuePairs": [
    {
      "confidence": 0,
      "key": {
        "polygon": [
            0.805,
            1.0025,
        ]
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      },
      "value": {
        "polygon": [
            0.805,
            1.0025,
        ]
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    }
  ],
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "rawText": "string",
  "requestDateTime": "string",
  "status": "SUCCESS",
  "tablesExtracted": [
    {
        "polygon": [
            0.805,
            1.0025,
        ]
      "cells": [
        []
      ],
      "columnCount": 0,
      "rowCount": 0,
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ]
    }
  ]
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["version"] = "2"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic"

payload = json.dumps({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE',
  'version':'2'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("version", "2");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("version", "2")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("version", "2")

  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("2", forHTTPHeaderField: "version")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
    'version: 2',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/generic", Method.Post);
                request.Timeout = -1;
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                request.AddHeader("version", 2);
                var body = @"{""inputUrl"":""https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"",""fileId"":""abc"",""metadata"":{},""webhook"":""google.com""}";
                request.AddParameter("application/json", body,  ParameterType.RequestBody);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "version: 2");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'version: 2' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE
version: 2

Body Parameters

{
  "inputUrl": https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf, 
  "fileId": abc,
  "metadata": {},
  "webhook": google.com
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
  "documentId": "string",
  "entitiesExtracted": [
    {
        "polygon": [
            0.805,
            1.0025,
        ]
      "category": "string",
      "confidence": 0,
      "content": "string",
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ],
      "subCategory": "string"
    }
  ],
  "isUrgent": true,
  "keyValuePairs": [
    {
      "confidence": 0,
      "key": {
        "polygon": [
            0.805,
            1.0025,
        ]
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      },
      "value": {
        "polygon": [
            0.805,
            1.0025,
        ]
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    }
  ],
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "rawText": "string",
  "requestDateTime": "string",
  "status": "SUCCESS",
  "tablesExtracted": [
    {
        "polygon": [
            0.805,
            1.0025,
        ]
      "cells": [
        []
      ],
      "columnCount": 0,
      "rowCount": 0,
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ]
    }
  ]
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via base64, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["version"] = "2"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "base64": "base64_string",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic"

payload = json.dumps({
  "base64": "base64_string",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE',
  'version':'2'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("version", "2");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "base64": "base64_string",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"base64\":\"base64_string\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("version", "2")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic"
  method := "POST"

  payload := strings.NewReader(`{"base64": "base64_string", "fileId": "abc", "metadata": {}, "webhook": "google.com"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("version", "2")

  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"base64\":\"base64_string\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("2", forHTTPHeaderField: "version")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"base64": "base64_string", "fileId": "abc", "metadata": {}, "webhook": "google.com"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
    'version: 2',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/generic", Method.Post);
                request.Timeout = -1;
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                request.AddHeader("version", 2);
                var body = @"{""base64"":""base64_string"",""fileId"":""abc"",""metadata"":{},""webhook"":""google.com""}";
                request.AddParameter("application/json", body,  ParameterType.RequestBody);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "version: 2");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"base64\":\"base64_string\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'version: 2' \
--header 'Content-Type: application/json' \
--data-raw '{"base64": "base64_string", "fileId": "abc", "metadata": {}, "webhook": "google.com"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE
version: 2

Body Parameters

{
  "base64": base64_string, 
  "fileId": abc,
  "metadata": {},
  "webhook": google.com
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
base64 json string true Base64 to extract PDF from.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
  "documentId": "string",
  "entitiesExtracted": [
    {
        "polygon": [
            0.805,
            1.0025,
        ]
      "category": "string",
      "confidence": 0,
      "content": "string",
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ],
      "subCategory": "string"
    }
  ],
  "isUrgent": true,
  "keyValuePairs": [
    {
      "confidence": 0,
      "key": {
        "polygon": [
            0.805,
            1.0025,
        ]
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      },
      "value": {
        "polygon": [
            0.805,
            1.0025,
        ]
        "content": "string",
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    }
  ],
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "rawText": "string",
  "requestDateTime": "string",
  "status": "SUCCESS",
  "tablesExtracted": [
    {
        "polygon": [
            0.805,
            1.0025,
        ]
      "cells": [
        []
      ],
      "columnCount": 0,
      "rowCount": 0,
      "spans": [
        {
          "length": 0,
          "offset": 0
        }
      ]
    }
  ]
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via multipart-form, get back a ZIP file

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic/zip")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["version"] = "2"
form_data = [['file', File.open('file_HERE')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/generic/zip"

payload={}

files=[
  ('file',('file_name',open('file_HERE','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE',
  'version': '2'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');
myHeaders.append("version", '2');


var formdata = new FormData();
formdata.append("file", 'file_HERE', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic/zip", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('file_HERE')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic/zip")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .addHeader("version", '2')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic/zip"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("file_HERE")
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base("file_HERE"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("version", "2")


  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": "file_HERE",
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("2", forHTTPHeaderField: "version")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic/zip',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLfile('file_HERE')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
    'version: 2'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/generic/zip");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("version", "2");
request.AddFile("file", "file_HERE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic/zip");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "version: 2");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/generic/zip

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'version: 2' \
--form 'file=@"file_HERE"'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE
version: 2

Body Parameters

file: file_HERE

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

File Contents

File Description
.csv CSV containing a breakdown of the itemization
.json JSON file containing the entire JSON response
.txt TXT file containing the entire JSON response
file Your uploaded file

The default name for the files are an epoch timestamp if fileId is not supplied.

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation A Zip File
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a ZIP file

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic/zip")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["version"] = "2"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic/zip"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("version", "2");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic/zip", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic/zip")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("version", "2")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic/zip"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("version", "2")

  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("2", forHTTPHeaderField: "version")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic/zip',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
    'version: 2',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/generic/zip");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("version", "2");
request.AddHeader("Content-Type", "application/json");
var body = @"{""inputUrl"":""inputUrl_HERE"",""fileId"":""fileId_HERE | Optional"",""metadata"":{""metadata_HERE | Optional""},""webhook"":""webhook_HERE | Optional""}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic/zip");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "version: 2");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic/zip

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'version: 2' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE
version: 2

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

File Contents

File Description
.csv CSV containing a breakdown of the itemization
.json JSON file containing the entire JSON response
.txt TXT file containing the entire JSON response
file Your uploaded file

The default name for the files are an epoch timestamp if fileId is not supplied.

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation A Zip File
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Async queue a URL via JSON, send a ZIP file to an output URL

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/generic/zip/async")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["version"] = "2"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE", 
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional",
  "outputUrl": "outputUrl_HERE",
  "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"}
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/generic/zip/async"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE", 
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional",
  "outputUrl": "outputUrl_HERE",
  "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"}
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE',
  'version':'2'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("version", "2");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE", 
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional",
  "outputUrl": "outputUrl_HERE",
  "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"}
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/generic/zip/async", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\",\"outputUrl\":\"outputUrl_HERE\",\"outputUrlHeaders\":{\"outputUrlHeaders_HERE | Optional\"");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/generic/zip/async")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("version", "2")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/generic/zip/async"
  method := "POST"

  payload := strings.NewReader(`{ "inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional", "outputUrl": "outputUrl_HERE", "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"} }`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("version", "2")

  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\",\"outputUrl\":\"outputUrl_HERE\",\"outputUrlHeaders\":{\"outputUrlHeaders_HERE | Optional\""
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/generic/zip/async")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("2", forHTTPHeaderField: "version")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/generic/zip/async',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{ "inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional", "outputUrl": "outputUrl_HERE", "outputUrlHeaders": {"outputUrlHeaders_HERE | Optional"} }',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
    'version: 2',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/generic/zip/async");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("version", "2");
request.AddHeader("Content-Type", "application/json");
var body = @"{ ""inputUrl"": ""inputUrl_HERE"", ""fileId"": ""fileId_HERE | Optional"", ""metadata"": {""metadata_HERE | Optional""}, ""webhook"": ""webhook_HERE | Optional"", ""outputUrl"": ""outputUrl_HERE"", ""outputUrlHeaders"": {""outputUrlHeaders_HERE | Optional""} }";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/generic/zip/async");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "version: 2");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\",\"outputUrl\":\"outputUrl_HERE\",\"outputUrlHeaders\":{\"outputUrlHeaders_HERE | Optional\"";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/generic/zip/async

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/generic/zip/async' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'version: 2' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": inputUrl_HERE, "fileId": fileId_HERE | Optional, "metadata": metadata_HERE | Optional, "webhook": webhook_HERE | Optional, "outputUrl": outputUrl_HERE, "outputUrlHeaders": outputUrlHeaders_HERE | Optional}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE
version: 2

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional,
  "outputUrl": outputUrl_HERE,
  "outputUrlHeaders": outputUrlHeaders_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
outputUrl json string true Url where to send output zip file. Must be open to PUT requests.
outputUrlHeaders json dict false Json with headers to be sent to your outputUrl.
webhook json string false Webhook to ping after API runs.

Example responses

202 Response

{
  "status": "RUNNING",
  "statusId": "string"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
202 RUNNING Accepted successful operation confirmationMessage
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage

OCR

Upload a file via multipart-form, get back a JSON

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/ocr")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('file_HERE')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/ocr"

payload={}

files=[
  ('file',('file_name',open('file_HERE','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');

var formdata = new FormData();
formdata.append("file", 'file_HERE', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/ocr", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('file_HERE')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/ocr")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/ocr"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("file_HERE")
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base("file_HERE"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": "file_HERE",
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/ocr")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/ocr',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLfile('file_HERE')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/ocr");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddFile("file", "file_HERE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/ocr");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/ocr

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/ocr' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--form 'file=@"file_HERE"'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

file: file_HERE

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

{
  "documentId": "string",
  "metadata": "string",
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "requestDateTime": "string",
  "status": "SUCCESS"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/ocr")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/ocr"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/ocr", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/ocr")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/ocr"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/ocr")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/ocr',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/ocr");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("Content-Type", "application/json");
var body = @"{""inputUrl"":""inputUrl_HERE"",""fileId"":""fileId_HERE | Optional"",""metadata"":{""metadata_HERE | Optional""},""webhook"":""webhook_HERE | Optional""}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/ocr");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/ocr

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/ocr' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
  "documentId": "string",
  "metadata": "string",
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "requestDateTime": "string",
  "status": "SUCCESS"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via base64, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/ocr")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('path_to_file')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/ocr"

files=[
  ('file',('file_name',open('path_to_file','rb'),'application/octet-stream'))
]

payload = json.dumps({
  "base64": "base64_string",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');

var formdata = new FormData();
formdata.append("file", 'path_to_file', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/ocr", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('path_to_file')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/ocr")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/ocr"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open(path_to_file)
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base(path_to_file))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": path_to_file,
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/ocr")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/ocr',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('path_to_file')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/ocr", Method.Post);
                request.Timeout = -1;
                request.AddHeader("Content-Type", "multipart/form-data");
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                request.AddFile("file", path_to_file);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }

CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/ocr");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/ocr

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/ocr' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--form 'file=@path_to_file'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

file: path_to_file

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

{
  "documentId": "string",
  "metadata": "string",
  "modelType": "string",
  "ocrResults": {
    "modelVersion": "string",
    "readResults": [
      {
        "angle": 0,
        "height": 0,
        "lines": [
          {
            "boundingBox": [
              0
            ],
            "content": "string",
            "spans": [
              {
                "length": 0,
                "offset": 0
              }
            ]
          }
        ],
        "pageNumber": 0,
        "selectionMarks": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "span": {
              "length": 0,
              "offset": 0
            },
            "state": "unselected"
          }
        ],
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ],
        "unit": "string",
        "width": 0,
        "words": [
          {
            "boundingBox": [
              0
            ],
            "confidence": 0,
            "content": "string",
            "span": {
              "length": 0,
              "offset": 0
            }
          }
        ]
      }
    ],
    "readStyles": [
      {
        "confidence": 0,
        "isHandwritten": true,
        "spans": [
          {
            "length": 0,
            "offset": 0
          }
        ]
      }
    ],
    "version": "string"
  },
  "requestDateTime": "string",
  "status": "SUCCESS"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Receipts

Upload a file via multipart-form, get back a JSON

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/receipts")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})

response = https.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/receipts"

payload={}

files=[
  ('file',('file_name',open('file_HERE','rb'),'application/octet-stream'))
]

payload = json.dumps({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/receipts", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/receipts")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/receipts"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/receipts/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/receipts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/receipts/zip", Method.Post);
                request.Timeout = -1;
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                var body = @"{""inputUrl"":""https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"",""fileId"":""abc"",""metadata"":{},""webhook"":""google.com""}";
                request.AddParameter("application/json", body,  ParameterType.RequestBody);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/receipts");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/receipts

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/receipts/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", 
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com"
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

{
    "documentId": "string",
    "metadata": {},
    "receiptData": {
        "receipts": [
            {
                "items": [
                    {
                        "name": "Expensive Hamburger",
                        "quantity": 1.0,
                        "total_price": 19.99
                    },
                    {
                        "name": "Very Large Soda",
                        "quantity": 1.0,
                        "total_price": 39.99
                    },
                    {
                        "name": "A LOT of French Fries",
                        "quantity": 1.0,
                        "total_price": 67.99
                    }
                ],
                "merchant_name": "string",
                "receipt_type": "Itemized",
                "subtotal": 127.97,
                "tax": 7.68,
                "total": 135.65,
                "transaction_date": "06/19/2017"
            }
        ]
    },
    "status": "SUCCESS"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/receipts")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", 
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com",
  "outputUrl": "youtube.com",
  "outputUrlHeaders": {"{"header_name":"header_value"}"}
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/receipts"

payload = json.dumps({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", 
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com",
  "outputUrl": "youtube.com",
  "outputUrlHeaders": {"{"header_name":"header_value"}"}
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", 
  "fileId": "abc",
  "metadata": {},
  "webhook": "google.com",
  "outputUrl": "youtube.com",
  "outputUrlHeaders": {"{"header_name":"header_value"}"}
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/receipts", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\",\"outputUrl\":\"youtube.com\",\"outputUrlHeaders\":{\"{"header_name":"header_value"}\"}}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/receipts")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/receipts"
  method := "POST"

  payload := strings.NewReader(`{ "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com", "outputUrl": "youtube.com", "outputUrlHeaders": {"{"header_name":"header_value"}"} }`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\",\"outputUrl\":\"youtube.com\",\"outputUrlHeaders\":{\"{"header_name":"header_value"}\"}}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/receipts/zip/async")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/receipts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{ "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "fileId": "abc", "metadata": {}, "webhook": "google.com", "outputUrl": "youtube.com", "outputUrlHeaders": {"{"header_name":"header_value"}"} }',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
class Program
    {
        private static string endpoint = "https://api.lazarusforms.com/api";
        private static string orgId = "orgId_HERE";
        private static string authKey = "authKey_HERE";

        static async Task Main(string[] args)
        {
            await Test();
        }

        private static async Task Test()
        {
            try
            {
                var client = new RestClient(endpoint);
                var request = new RestRequest("/forms/receipts/zip/async", Method.Post);
                request.Timeout = -1;
                request.AddHeader("orgId", orgId);
                request.AddHeader("authKey", authKey);
                var body = @"{ ""inputUrl"": ""https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"", ""fileId"": ""abc"", ""metadata"": {}, ""webhook"": ""google.com"", ""outputUrl"": ""youtube.com"", ""outputUrlHeaders"": {""{"header_name":"header_value"}""} }";
                request.AddParameter("application/json", body,  ParameterType.RequestBody);
                RestResponse response = await client.ExecutePostAsync(request);
                Console.WriteLine(response.Content);
           }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/receipts");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf\",\"fileId\":\"abc\",\"metadata\":{},\"webhook\":\"google.com\",\"outputUrl\":\"youtube.com\",\"outputUrlHeaders\":{\"{"header_name":"header_value"}\"}}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/receipts

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/receipts/zip/async' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf, "fileId": abc, "metadata": {}, "webhook": google.com, "outputUrl": youtube.com, "outputUrlHeaders": {"header_name":"header_value"}}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf, 
  "fileId": abc,
  "metadata": {},
  "webhook": google.com,
  "outputUrl": youtube.com,
  "outputUrlHeaders": {"header_name":"header_value"}
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
    "documentId": "string",
    "metadata": {},
    "receiptData": {
        "receipts": [
            {
                "items": [
                    {
                        "name": "Shirt",
                        "quantity": 1.0,
                        "total_price": 19.99
                    },
                    {
                        "name": "Jeans",
                        "quantity": 1.0,
                        "total_price": 39.99
                    },
                    {
                        "name": "Dress",
                        "quantity": 1.0,
                        "total_price": 67.99
                    }
                ],
                "merchant_name": "string",
                "receipt_type": "Itemized",
                "subtotal": 127.97,
                "tax": 7.68,
                "total": 135.65,
                "transaction_date": "06/19/2017"
            }
        ]
    },
    "status": "SUCCESS"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation completeDocument
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via multipart-form, get back a ZIP file

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/receipts/zip")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('file_HERE')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/receipts/zip"

payload={}

files=[
  ('file',('file_name',open('file_HERE','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');

var formdata = new FormData();
formdata.append("file", 'file_HERE', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/receipts/zip", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('file_HERE')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/receipts/zip")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/receipts/zip"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("file_HERE")
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base("file_HERE"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": "file_HERE",
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/receipts/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/receipts/zip',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLfile('file_HERE')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/receipts/zip");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddFile("file", "file_HERE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/receipts/zip");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/receipts/zip

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/receipts/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--form 'file=@"file_HERE"'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

file: file_HERE

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

File Contents

File Description
data.csv CSV containing a breakdown of the itemization
data.json JSON file containing the entire JSON response
data.txt TXT file containing the entire JSON response
file Your uploaded file

The default name for the files are an epoch timestamp if fileId is not supplied.

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation A Zip File
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a ZIP file

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/receipts/zip")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/receipts/zip"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/receipts/zip", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/receipts/zip")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/receipts/zip"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/receipts/zip")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/receipts/zip',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/receipts/zip");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("Content-Type", "application/json");
var body = @"{""inputUrl"":""inputUrl_HERE"",""fileId"":""fileId_HERE | Optional"",""metadata"":{""metadata_HERE | Optional""},""webhook"":""webhook_HERE | Optional""}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/receipts/zip");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/receipts/zip

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/receipts/zip' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

File Contents

File Description
data.csv CSV containing a breakdown of the itemization
data.json JSON file containing the entire JSON response
data.txt TXT file containing the entire JSON response
file Your uploaded file

The default name for the files are an epoch timestamp if fileId is not supplied.

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation A Zip File
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Custom

This section is for custom trained models for your specific use case.

The major difference in calling this endpoint is the
<your_custom_model_id_HERE> is part of the URL as a path rather than a value that you send in the HTTP Request body.

Upload a file via multipart-form, get back a JSON

Code Samples

require "uri"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('file_HERE')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

import requests

url = "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE"

payload={}

files=[
  ('file',('file_name',open('file_HERE','rb'),'application/octet-stream'))
]

headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.json())


var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append("authKey", 'authKey_HERE');

var formdata = new FormData();
formdata.append("file", 'file_HERE', 'file_name');

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file",'file_name',
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File('file_HERE')))
  .build();
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")
  .method("POST", body)
  .addHeader("orgId", 'orgId_HERE')
  .addHeader("authKey", 'authKey_HERE')
  .build();
Response response = client.newCall(request).execute();

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "os"
  "path/filepath"
  "io"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE"
  method := "POST"

  payload := &bytes.Buffer{}
  writer := multipart.NewWriter(payload)
  file, errFile1 := os.Open("file_HERE")
  defer file.Close()
  part1,
         errFile1 := writer.CreateFormFile("file",filepath.Base("file_HERE"))
  _, errFile1 = io.Copy(part1, file)
  if errFile1 != nil {
    fmt.Println(errFile1)
    return
  }
  err := writer.Close()
  if err != nil {
    fmt.Println(err)
    return
  }


  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")

  req.Header.Set("Content-Type", writer.FormDataContentType())
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = [
  [
    "key": "file",
    "src": "file_HERE",
    "type": "file"
  ]] as [[String : Any]]

let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
  if param["disabled"] == nil {
    let paramName = param["key"]!
    body += "--\(boundary)\r\n"
    body += "Content-Disposition:form-data; name=\"\(paramName)\""
    if param["contentType"] != nil {
      body += "\r\nContent-Type: \(param["contentType"] as! String)"
    }
    let paramType = param["type"] as! String
    if paramType == "text" {
      let paramValue = param["value"] as! String
      body += "\r\n\r\n\(paramValue)\r\n"
    } else {
      let paramSrc = param["src"] as! String
      let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
      let fileContent = String(data: fileData, encoding: .utf8)!
      body += "; filename=\"\(paramSrc)\"\r\n"
        + "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
    }
  }
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('file'=> new CURLfile('file_HERE')),
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddFile("file", "file_HERE");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  curl_mime *mime;
  curl_mimepart *part;
  mime = curl_mime_init(curl);
  part = curl_mime_addpart(mime);
  curl_mime_name(part, "file");
  curl_mime_filedata(part, "file_name");
  curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
  res = curl_easy_perform(curl);
  curl_mime_free(mime);
}
curl_easy_cleanup(curl);

POST /forms/custom

Curl Request


curl --location --request POST 'https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--form 'file=@"file_HERE"'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

file: file_HERE

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
file body fileObject true File to upload: Must be a PDF, JPEG, PNG, or TIFF.

Example responses

200 Response

{
  "message":"Response formats are dependent on your specifications"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation Custom Response
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a URL via JSON, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE"

payload = json.dumps({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", "orgId_HERE");
myHeaders.append("authKey", "authKey_HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "inputUrl": "inputUrl_HERE",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}");
Request request = new Request.Builder()
  .url("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")
  .method("POST", body)
  .addHeader("orgId", "orgId_HERE")
  .addHeader("authKey", "authKey_HERE")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE"
  method := "POST"

  payload := strings.NewReader(`{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("orgId", "orgId_HERE")
  req.Header.Add("authKey", "authKey_HERE")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}


import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

var semaphore = DispatchSemaphore (value: 0)

let parameters = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")!,timeoutInterval: Double.infinity)
request.addValue("orgId_HERE", forHTTPHeaderField: "orgId")
request.addValue("authKey_HERE", forHTTPHeaderField: "authKey")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    semaphore.signal()
    return
  }
  print(String(data: data, encoding: .utf8)!)
  semaphore.signal()
}

task.resume()
semaphore.wait()

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}',
  CURLOPT_HTTPHEADER => array(
    'orgId: orgId_HERE',
    'authKey: authKey_HERE',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
var client = new RestClient("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("orgId", "orgId_HERE");
request.AddHeader("authKey", "authKey_HERE");
request.AddHeader("Content-Type", "application/json");
var body = @"{""inputUrl"":""inputUrl_HERE"",""fileId"":""fileId_HERE | Optional"",""metadata"":{""metadata_HERE | Optional""},""webhook"":""webhook_HERE | Optional""}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
  curl_easy_setopt(curl, CURLOPT_URL, "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE");
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, "orgId: orgId_HERE");
  headers = curl_slist_append(headers, "authKey: authKey_HERE");
  headers = curl_slist_append(headers, "Content-Type: application/json");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  const char *data = "{\"inputUrl\":\"inputUrl_HERE\",\"fileId\":\"fileId_HERE | Optional\",\"metadata\":{\"metadata_HERE | Optional\"},\"webhook\":\"webhook_HERE | Optional\"}";
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
  res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);

POST /forms/custom

Curl Request

curl --location --request POST 'https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE' \
--header 'orgId: orgId_HERE' \
--header 'authKey: authKey_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{"inputUrl": "inputUrl_HERE", "fileId": "fileId_HERE | Optional", "metadata": {"metadata_HERE | Optional"}, "webhook": "webhook_HERE | Optional"}'

Header Parameters

orgId: orgId_HERE
authKey: authKey_HERE

Body Parameters

{
  "inputUrl": inputUrl_HERE, 
  "fileId": fileId_HERE | Optional,
  "metadata": metadata_HERE | Optional,
  "webhook": webhook_HERE | Optional
}

Parameters

Name In Type Required Description
orgId header string true Organization ID
authKey header string true Authentication Key
inputUrl json string true Url to file to extract from: Must be a PDF, JPEG, PNG, or TIFF.
fileId json string false Custom ID for document. If not present, will default to file name.
metadata json dict false Custom JSON to be sent in the returned response.
webhook json string false Webhook to ping after API runs.

Example responses

200 Response

{
  "message":"Response formats are dependent on your specifications"
}

400 Response

{
  "status": "FAILURE",
  "message": "string"
}

401 Response

{
  "status": "AUTH_FAILURE",
  "message": "string"
}

403 Response

{
  "status": "FAILURE",
  "message": "string"
}

418 Response

{
  "status": "FAILURE",
  "message": "string"
}

Responses

Response Status Meaning Description Schema
200 SUCCESS OK successful operation
400 FAILURE Bad Request bad request and failure to read errorMessage
401 AUTH_FAILURE Unauthorized unauthorized attempt errorMessage
403 FAILURE Forbidden Invalid subscription. errorMessage
418 FAILURE Unknown Something went wrong that we don't understand. errorMessage

Upload a file via base64, get back a JSON

Code Samples

require "uri"
require "json"
require "net/http"

url = URI("https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orgId"] = "orgId_HERE"
request["authKey"] = "authKey_HERE"
form_data = [['file', File.open('path_to_file')]]
request.set_form form_data, 'multipart/form-data'
response = http.request(request)
puts response.read_body

response = https.request(request)
puts response.read_body

import requests
import json

url = "https://api.lazarusforms.com/api/forms/custom/your_custom_model_id_HERE"

files=[
  ('file',('file_name',open('path_to_file','rb'),'application/octet-stream'))
]

payload = json.dumps({
  "base64": "base64_string",
  "fileId": "fileId_HERE | Optional",
  "metadata": {"metadata_HERE | Optional"},
  "webhook": "webhook_HERE | Optional"
})
headers = {
  'orgId': 'orgId_HERE',
  'authKey': 'authKey_HERE'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

var myHeaders = new Headers();
myHeaders.append("orgId", 'orgId_HERE');
myHeaders.append(