Testing Invoice Retrieval by ID

Step 1: Create Request

  1. In the InvoiceGetAPI-Tests Collection, click the "+" button to create a new request.

Test get all invoices by ID

  1. Name the request: Get Invoices By ID.

Test get all invoices by ID

  1. Select the GET method.

Test get all invoices by ID

  1. Go to API Gateway and select the API: GetInvoiceAPI.

  2. Navigate to the Stages section.

  3. Click the "+" button to reveal the /invoice/{id} endpoint path as shown below:

Test get all invoices by ID

  1. Select the GET method and copy the Invoke URL.

Test get all invoices by ID

  1. Paste the Invoke URL into Postman as follows:

Test get all invoices by ID

  1. Replace {id} in the API endpoint with an actual Invoice ID from DynamoDB:
https://x4uqolxky6.execute-api.us-east-1.amazonaws.com/dev/invoice/<InvoiceId_from_DynamoDB>

Test get all invoices by ID

Test get all invoices by ID

  1. Click the Send button to view results.

Test get all invoices by ID

  1. A successful response will appear as follows:

Test get all invoices by ID

You can now test the remaining 2 invoice files!