Azure form recogniser- REST api- Input format not accepted

Neha Srivastava 1 Reputation point
2021-01-01T12:29:50.027+00:00

Hello all
I am using Azure form recogniser to extract data from PDF. I have created a custom model using FOTT. I am able to analyse a new form by sending request using PostMan tool only if I send PDF file in request body, as binary. My application is using .net framework 4.8 and I am trying to create a REST call. I have tried sending a Post request using RestClient, content type as 'application/pdf', and content as byte array. The request gets accepted and I do receive operation-location in response header.

But if I try to send this get request I get an error- "The file submitted couldn't be parsed. This can be due to one of the following reasons: the file format is not supported (Supported formats include JPEG, PNG, BMP, PDF and TIFF), the file is corrupted or password protected."

I have also tried sending base64 string, but that also didn't work.

I have also tried sending the base64 string in postman, by selecting body as raw text, and there also same thing happens. I.e. Post request is accepted, but while fetching extracted details, above mentioned error comes.

Can someone please help with the solution. Thanks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,457 questions
Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,467 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,621 Reputation points
    2021-01-04T11:02:04.117+00:00

    @Neha Srivastava Thanks for the question, If your PDFs are password-locked, you must remove the lock before submitting them. Can you please share the PDF to check and add details about the REST API that you are trying.

    53259-image.png

    Please follow the Sample Form Recognizer Tool, follow a QuickStart, explore the Form Recognizer REST API or use the Client Libraries to extract data from your documents.