After obtaining the API Gateway endpoint, you need to send POST and GET requests to the API to confirm that the backend is functioning properly. This is typically done using Postman, the most popular API testing tool.
Steps to follow:
Testing POST Method with Postman
Open Postman, select New → HTTP Request.
Set the method to POST.
Enter the full endpoint URL, for example:
https://ars3538v1i.execute-api.ap-southeast-1.amazonaws.com/Prod/api/users
Switch to the Body tab → select raw → choose JSON.
Enter sample data in the body as follows:
{
"username": "AdminUser",
"email": "firstcloudjourney@example.com",
"password": "AdminUser123@",
"firstName": "Admin",
"lastName": "User",
"isAdmin": true,
"googleId": null,
"avatar": "https://i.imgur.com/avatar.jpg",
"phone": "0912345678",
"address": "",
"isDeleted": false
}
Click Send to submit the request.
If the API works correctly, you will receive a confirmation response.
Copy the returned token
to use for subsequent requests.
If the API requires authentication (API Key
, Bearer Token, etc.) or custom headers, add them in the Headers tab of Postman before sending the request!
Testing GET Method for Login with Postman
Go to DynamoDB on the AWS Console.
Select the ShopUser table.
Choose Explore table items to check the data for the newly created user.
Scroll down and edit the isAdmin field for the created user to true
.
Create a new request in Postman, set the method to GET.
Enter the full endpoint URL, for example:
https://ars3538v1i.execute-api.ap-southeast-1.amazonaws.com/Prod/api/users
In the Authorization section, choose: Bearer Token.
In the Token field: paste the previously saved token.
Click Send to submit the request.
If the API is functioning correctly, you will receive a response with the user data from the database.
Check the HTTP status code (should be 200 OK) and the response body.
You can test other project functionalities by reviewing the code to find the respective API URLs.
Analyzing Results and Handling Common Errors
403 Forbidden
, 401 Unauthorized
, or Missing Authentication Token
:
500 Internal Server Error
:
Conclusion:
Testing the API using POST/GET requests is an essential step to confirm that the backend is functioning correctly before integrating with the frontend or deploying to production. If errors occur, check CloudWatch logs or review the API Gateway and Lambda configurations for timely troubleshooting.