- Newest
- Most votes
- Most comments
You pass in the request syntax JSON as the request. Also it is important to note that you will need to get an image/pdf file, and pass it through the payload of the request as a Byte array or S3 object - which what I see that you have done correctly. But you have to authenticate (sign it: https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html), that is the harder part. The response does not give the processed output, but only the JobID and status. To authenticate before you call, you need to setup your IAM user in postman using the following steps:
- Obtain the access key and secret key for the IAM user.
- Open Postman and create a new POST request.
- In the Authorization tab, select "AWS Signature" from the TYPE dropdown menu.
- In the Access Key field, enter the access key for the IAM user.
- In the Secret Key field, enter the secret key for the IAM user.
- In the AWS Region field, enter the region where you want to make the API call (e.g., "us-west-2").
- In the Service Name field, enter "textract".
- In the Request URI field, enter the appropriate endpoint for the AnalyzeExpense action.
- Add a JSON payload to the Body of the request with the necessary attributes and values to call the API
- Send the request
It is important to note that the AnalyzeExpense API is part of the Textract async operations, which means the first request will return a JobId and the actual results will be on a different endpoint, you will need to keep checking the Job Status endpoint with that jobId until it is complete.
I see you have the endpoint correctly picked as well. Here is the page that shows a full list of endpoints used for each service per region. Here is a direct link to textract specifically: https://docs.aws.amazon.com/general/latest/gr/textract.html The section https://docs.aws.amazon.com/textract/latest/dg/API_Operations.html describes the request and response structures for each of the APIs. Have you taken a look at this document - https://docs.aws.amazon.com/textract/latest/dg/API_Reference.html
Relevant content
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 11 days ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago
Thanks for your reply. I guess that I'm authenticated because I try to analyse uploaded file to S3 storage that I uploaded with API and uploading was successful. I think that I've problem with 'AnalyseExpense' part in URL. I don't know how can I pass it to URL. I tried as key 'action' or 'actions' and value 'AnalyseExpense' but nothing works. I could not find any information about name of query param or value. So if this URL is not correct, which one is? https://textract.eu-west-2.amazonaws.com?action=AnalyzeExpense
If you gave me an example of correct API URL request for AnalyzeExepense, I would be happy cuz I'm still lost. Thanks