I am trying to build an API call to an external system but cannot make it work.
The intended use case is that a user will upload a picture of a receipt, and it will then be sent to an OCR scanner application, who will return JSON data extracted from the receipt.
The OCR application is OCR API for Real-Time Data Extraction from Receipts & Invoices
The API docs are only available to account holders, so I will C&P the relevant sections.
I have gone into business logic to build the API service, and the first function I want to add is a POST function that sends an uploaded receipt to the OCR scanner. The function name is Send-receipt.
The API docs instruct me to send the following auth parameters in the header of the request:
I have included these in the the logic for the API service:
The API documents then show the format for the CURL request:
I have used the correct path name, and query fields, but the problem occurs before this stage because I get a 400 error saying NOT AUTHORIZED when I try to invoke the API service in business logic.
The path name and API credentials are correct, so I am stuck with this. I have contacted Veryfi but they need to see the code being submitted with the request, and I can’t find where I can access this.
Am I doing something wrong with my logic? Or, if not, is there somewhere I can get code samples for Veryfi?