202 status from Cognitive services

wrappingduke 21 Reputation points

I'm attempting to analyze forms (i.e. receipts) using Azure's Cognitive Services but having some trouble. When a call is made to the service to retrieve the Operation ID, a http status of 202 or Accepted is returned from service.

Help is appreciated.

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,195 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 43,076 Reputation points


    Thanks for reaching out to us. A 202 response is not an error code, instead it means that your first POST API call was successful. The next step would be to make a GET call using the Operation-Location from your response and the same subscription key you used before.

    The service has accepted the request and will start processing soon. The client can query the operation status and result using the URL specified in the 'Operation-Location' response header. The URL expires in 48 hours.

    Operation-Location URL containing the resultId used to track the progress and obtain the result of the analyze operation.
    Example: https://cognitiveservice/formrecognizer/v2.0-preview/custom/models/{modelId}/analyzeResults/{resultId}