Form Recognizer REST API

Andrew Fan 31 Reputation points
2022-07-12T17:43:59.7+00:00

Hi everyone,

I want to use the Form Recognizer REST API to analyze a document and then retrieve the results. I am using the quickstart guide here (https://learn.microsoft.com/en-us/azure/applied-ai-services/form-recognizer/quickstarts/try-v3-rest-api) and the sample document for a Layout model. I am using the POST request curl command (curl -v -i POST "{endpoint}/formrecognizer/documentModels/{modelID}:analyze?api-version=2022-06-30-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {key}" --data-ascii "{'urlSource': '{your-document-url}'}") and have replaced {endpoint}, {key}, {modelID} and {your-document-url} with the correct values. However, when I run this, I keep getting the following error:

{"error":{"code":"InvalidArgument","message":"Invalid argument.","innererror":{"code":"ParameterMissing","message":"The parameter urlSource or base64Source is required."}}}

I'm confused because I have the urlSource parameter filled, I put the url to the sample document. Any guidance would be appreciated, thanks!

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,902 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 48,526 Reputation points Microsoft Employee
    2022-07-13T07:46:50.233+00:00

    @Andrew Fan This post request should work with the above command. The error indicates something is wrong with the format of the request. Here is a screen shot of my request that worked with the same command for reference. Also, If possible to share, what is the actual URL specified in your request?

    220274-image.png


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.