Run an error generating flow

Invoke the POST method of Application microservice API with already existing ApplicationId in the request body which will generate a valid technical error

  • Create an Application Resource

Please change the URL of the API with the URL of the API Gateway resources that you created. You can get the URL of the API from the API Gateway by visiting the API Gateway Console -> Stages -> resources -> method. You will find the Invoke URL on the right panel

Use the previously created applicationId in the below request body

Execute below HTTP POST request invoking Application microservice

curl -X POST <URL of your API> -H 'Authorization: <Your IdToken>' -H 'Content-Type: application/json' -H 'cache-control: no-cache' -d '{"applicationId":"microservice-test-app","author":"team","description":"Reinvent microservice demo","homePageUrl":"https://www.amazon.com"}'
  • API will return a valid error as below in the response body with HTTP Response code of - 409.

In addition, the API will return a globally unique Request Identifier in the HTTP response header with name x-amzn-RequestId. Please copy the requestId since we will need it to troubleshoot the errorCode

{
  "message": "Application microservice-test-app already exists.",
  "errorCode": "ApplicationAlreadyExist"
}