Verify the Connection

At this point, both Lambda functions are connected to API Gateway. Let’s do a quick check before moving to full testing.


Check the integration

  1. In API Gateway, click on /loginPOSTIntegration Request

  2. Confirm Lambda Function shows loginFunction

  3. Click on /songsGETIntegration Request

  4. Confirm Lambda Function shows getSongsFunction

  5. Click on /songsGETMethod Request

  6. Confirm Authorization shows CognitoAuthorizer

Check integration login Check integration songs Check authorizer


Quick test from the console

API Gateway has a built-in test tool.

Test POST /login

  1. Click /loginPOSTTEST (lightning bolt icon)
  2. In Request Body, paste:
{
  "email": "test@example.com",
  "password": "Test@12345"
}
  1. Click Test
  2. Expected result: Status: 200 with idToken, accessToken, refreshToken in the response body

Test GET /songs without token

  1. Click /songsGETTEST
  2. Leave everything empty → Test
  3. Expected result: Status: 401 — the authorizer blocks the request

Test GET /songs with token

  1. First get a token from the login test above — copy the idToken
  2. Click /songsGETTEST
  3. In Headers, add:
    Authorization: <paste idToken here>
    
  4. Click Test
  5. Expected result: Status: 200 with the songs list

If all three tests pass, the setup is correct. Proceed to the Testing section for end-to-end testing with a real HTTP client.