Search code examples
apirestpostmanamazon-connect

Amazon Connect API didn't response correctly in Postman


I am trying to test Amazon Connect Rest API in Postman. The API name is GetMetricData. In Postman, I have provided all the required information that is mentioned in the documentation. I have provided the JSON body, URL, and Header, although API is responding 200 OK status but in the response, it is throwing the following errors that you can see in the following screenshots. First screenshot with the complete API details Response 1 Response 2 Errors are here I have set AWS signature with proper credentials such as access key and secret key AWS credentials

In the second error it is suggesting me to enable Javascript in the browser which is already enabled in my browser. Can someone please help me here, I don't know where I am doing wrong. As I am totally new in this field, any help would be appreciated. Thanks


Solution

  • You are submitting the POST request to the UI distribution endpoint for your Amazon Connect instance, not an API endpoint. You are getting HTML and javascript response body back from the UI distribution because this is meant to be consumed by a browser.

    Your API request should be sent to a URL that looks like https://connect.us-west-2.amazonaws.com/metrics/historical/<instanceId>. In this example, my Amazon Connect instance is located in the us-west-2 region so I'm using the connect.us-west-2.amazonaws.com endpoint. You can find all available Amazon Connect API endpoints in the documentation here