Welcome to API Learning 101! This repository is your comprehensive guide to understanding and working with APIs, complete with a fully functional REST API backend and hands-on learning resources.
Backend API: api-learning.nisalgunawardhana.com
This repository provides:
- Complete API fundamentals - HTTP methods, status codes, headers, REST principles
- Working backend API - Real API you can interact with
- Postman collection - Ready-to-use API tests
- Hands-on examples - Practical demonstrations
- Best practices - Industry-standard approaches
api-learning-101/
βββ docs/
β βββ 01-what-is-api.md
β βββ 02-http-methods.md
β βββ 03-status-codes.md
β βββ 04-rest-principles.md
β βββ 05-postman-guide.md
β βββ screenshots/
βββ backend/
β βββ api/
β β βββ index.js
β βββ data/
β β βββ users.json
β βββ package.json
β βββ README.md
βββ postman/
β βββ API-Learning-101.postman_collection.json
βββ .github/
β βββ ISSUE_TEMPLATE/
β βββ workflows/
βββ vercel.json
π Postman Workspace: API Learning 101 Collection
- Open the public Postman workspace link above
- Fork the collection to your workspace
- Start testing with the live API at
https://api-learning.nisalgunawardhana.com
If you want to test locally:
# Clone the repository
git clone https://github.com/nisalgunawardhana/api-learning-101.git
cd api-learning-101
# Install dependencies
cd backend
npm install
# Run locally
npm startThe API will be available at http://localhost:3000
Base URL: https://api-learning.nisalgunawardhana.com
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users |
Get all users |
| GET | /api/users/:id |
Get user by ID |
| POST | /api/users |
Create new user |
| PUT | /api/users/:id |
Update user |
| DELETE | /api/users/:id |
Delete user |
| GET | /api/reset |
Reset data to initial state |
π‘ Note about Data Persistence:
- The API uses in-memory storage (no database required!)
- Data persists during the serverless function's lifetime
- Changes are temporary and reset periodically on Vercel
- Use
GET /api/resetto manually reload initial data - Perfect for learning and testing without worrying about data cleanup!
Follow these guides in order:
- Visit the public workspace: API Learning 101 Collection
- Click Fork Collection to add it to your workspace
- All requests are pre-configured with the production URL
You must test all request types and capture screenshots for submission:
- Select
GET All Usersfrom the collection - Click Send
- Verify status code:
200 OK - Take a screenshot showing:
- Request URL
- Response status
- Response body with user data
- Select
GET User by IDfrom the collection - Replace
:idwith1in the URL - Click Send
- Verify status code:
200 OK - Take a screenshot
- Select
POST Create Userfrom the collection - Go to Body tab (raw JSON)
- Use this sample data:
{ "name": "Your Name", "email": "yourname@example.com", "age": 25 } - Click Send
- Verify status code:
201 Created - Take a screenshot showing the created user with generated ID
- Select
PUT Update Userfrom the collection - Use the ID from your created user
- Update the data in Body:
{ "name": "Updated Name", "email": "updated@example.com", "age": 26 } - Click Send
- Verify status code:
200 OK - Take a screenshot showing the updated user
- Select
DELETE Userfrom the collection - Use the ID of the user you created
- Click Send
- Verify status code:
200 OK - Take a screenshot showing successful deletion message
Create a folder named screenshots-[your-github-username] with all 5 screenshots:
screenshots-yourusername/
βββ 01-get-all-users.png
βββ 02-get-single-user.png
βββ 03-post-create-user.png
βββ 04-put-update-user.png
βββ 05-delete-user.png
- Add your screenshots to the
docs/screenshots/folder - Create a Pull Request with your screenshots
- Go to Issues β New Issue
- Select π Submission template
- Fill in:
- Your name
- GitHub username
- PR number
- T-shirt size (for winners only)
- Submit the issue
Note: Your submission will be automatically assigned to @nisalgunawardhana for review. Once approved, you'll receive completion badges!
Increase your chances to win Postman swags:
- Share your completion on Twitter/LinkedIn/Facebook
- Tag @NisalGunawardhana and @Postman
- Use hashtag #APILearning101
- Winners will be selected randomly from all approved submissions!
After successful submission and review:
Everyone receives:
- β Submission Approved Badge
- π API Learning 101 Completion Badge
Random winners receive:
- π Exclusive T-Shirt (winners selected randomly)
- π Chance for Postman Swags (share on social media for more chances!)
We've included a comprehensive Postman collection with pre-configured requests:
- β All CRUD operations
- β Pre-request scripts
- β Tests for validation
- β Environment variables
See the Postman Guide for detailed instructions.
- Runtime: Node.js
- Framework: Express.js
- Storage: JSON file (no database needed!)
- Hosting: Vercel
We welcome contributions! Please submit your work:
- Fork the repository
- Create your feature branch
- Make your changes
- Submit a pull request
- Create a submission issue
Your submission will be reviewed and you'll receive contributor badges!
- Complete your work and create a PR
- Use the Submission issue template
- Fill in all required details
- Your submission will be automatically tagged and assigned for review
- Receive your contributor badge upon approval! π
Contributors receive badges based on their submissions:
- π‘ Pending Review
- β Approved
- π Closed/Completed
MIT License - feel free to use this for learning!
Nisal Gunawardhana (@nisalgunawardhana)
Happy Learning! π
