How to use Postman to hit AWS Comprehend Endpoint

0

Hi,

I have a custom classifierDocument endpoint that has been configured in AWS Comprehend and is ready for real time analysis and works well. I am now trying to hit that endpoint with Postman, but i keep getting an error. Is my url incorrect or one of my headers? The error and postman configs are as follows:

Postman Config:
Post: https://comprehend.us-east-1.amazonaws.com/

Authorization:
AWS Signature
AccessKey: <AK>
SecretKey: <SK>
AWS Region: us-east-1
Service Name: comprehend:ClassifyDocument

Headers:
Auth: <stuff>
X-AMZ-Content-SHA256: <stuff>
X-AMZ-Date: <stuff>
Content-Type: application/json
Host: <stuff>
PostmanToken: <stuff>
User Agent: <stuff>
Accept: all
AcceptEncoding: gzip, deflate, br
Connection: keep alive

Body:
raw-text
{
"Text": "Emotional Intelligence (EQ), popularized by best-selling author Daniel Goleman has been validated with multiple research studies to be a key differentiator in work performance. Emotions",
"EndpointArn": "arn:aws:comprehend:us-east-1:[stuff]:document-classifier-endpoint/pravsFirstEnd"
}

Text Response Error:
<AccessDeniedException>
<Message>Unable to determine service/operation name to be authorized</Message>
</AccessDeniedException>

Json Response Error:
{
"Output": {
"__type": "com.amazon.coral.service#UnknownOperationException"
},
"Version": "1.0"
}

prav1
asked 4 years ago2261 views
1 Answer
0

Hi,

Referred to an older post/forum made by ForzenCoder(RestAPI with Comprehend) and saw what was missing. Note to to future peeps running into this issue.

Changes/Additions Made:
Service - comprehend
X-Amz-Target - Comprehend_20171127.ClassifyDocument
Content-Type - application/x-amz-json-1.1

Getting proper response now. All is well.

prav1
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions