Fork me on GitHub

Module ocra2ia rest

Presentation

This module exposes a rest web service to perform OCR of a document. The web service is in Post mode and is exposed on the URL http://<server host><server port>/<site path>/rest/ocr/start

To perform OCR on document send a request like this :

                   curl --header "Content-Type: application/json" --request POST --data '{"filecontent":"9j/4AAQSkZJRg....","fileextension":"Jpeg", "documenttype":"rib"}' http://localhost:8080/ocr/rest/ocr/start
                
The data request must be a json flux with 3 keys :
  • filecontent : image file encoded in base64.
  • fileextension : extension of the image file.
  • documenttype : type of document to proceed by OCR.

The response of the web service is the OCR result in a json flux :

                   {
                     "Rib result": "30066_XXXXX_00010461001_XX",
                     "Code Banque": "30066",
                     "RIB Address": "Monsieur Xxxx 80 RUE XXXXXX 75009 PARIS ",
                     "Clé RIB": "XX",
                     "IBAN": "FRXXXXXXXXXXXXXXXXXXXXXXXXX",
                     "Account number": "XXXXXX",
                     "Code Guichet": "XXXXX",
                     "BIC": "XXXXX"
                   }