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
已提問 4 年前檢視次數 2288 次
1 個回答
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
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南