Local path as body in Azure Form Recognizer Api

Mahalakshmi Natarajan 21 Reputation points
2022-12-05T08:00:50.53+00:00

How can i pass the local file path (eg.C:\Users\12345\Desktop\test.pdf) as a body in rest api - azure form recognizer?

{
"source": "C:\Users\12345\Desktop\test.pdf"
}

I have tried this. But it says parameter missing.

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
2,100 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 48,906 Reputation points Microsoft Employee Moderator
    2022-12-06T13:00:55.517+00:00

    @Mahalakshmi Natarajan I believe you are using the v2.1 version of the REST API based on the "source" parameter used in the body of the request.
    In any case, you can't pass the path to your local file through REST API directly. You will have to use a tool like postman or convert your PDF to binary data and use the binary data in the request body along with the header application/pdf to the analyze API. Here is a screen shot of how you can use local file with REST API.

    Choose "binary" as the request body and attach your PDF file in the request. Once the request is submitted you will receive a 202 response with operation location.
    267739-image.png

    Use a GET request with the above operation location and retrieve the result to get the analyzed text of your PDF.
    267793-image.png

    I hope this helps!!

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.