Understanding APIs: Types and Custom
Endpoint Creation
c
Gideon Yegon
Software Engineer
13/11/2025
1900HRS
c
1
4
2
5
3
7
6
API = Application Programming Interface
What is an API?
It’s a bridge that allows two applications to communicate.
Example:
●When you log in with Google Your app uses Google’s API
→
to authenticate you.
Visual: Diagram showing two apps talking via an API.
8
9
1
4
2
5
3
7
6
What is an API?
8
9
Frontend
Server
API
2
4
1
5
3
7
6
8
9
Why APIs Matter
● Enable integration between systems
● Encourage reusability of code
● Support automation and scalability
●Power modern apps: mobile, web, IoT, AI, etc.
Example:
Uber uses APIs for maps, payments, and messaging.
2
4
1
5
3
7
6
8
9
Name an API you have interacted with
3
4
1
5
2
7
6
Types of APIs
8
9
Type Description Example
RESTful Uses HTTP and resources (URLs). GET /users
GraphQL Query language for APIs; fetch only what
you need.
{ user { name,
email } }
SOAP XML-based; strict protocol. <soap:Envelope>
WebSocket Real-time communication. Chat apps
gRPC Uses Protocol Buffers for fast
communication.
Microservices
RESTful APIs – The Standard
Core Ideas:
●Stateless communication
● Uses HTTP methods
●Returns data (usually JSON)
●Resource-based URLs
GET https://api.example.com/users
POST https://api.example.com/users
4
3
1
5
2
7
6
8
9
5
3
1
4
2
7
6
8
9
HTTP Methods
Method Action Example
GET Retrieve data /users
POST Create new data /users
PUT Update existing data /users/1
DELETE Remove data /users/1
6
3
1
4
2
7
5
HTTP Status Codes
8
9
Code Meaning Example
200 OK – Request successful ✅
201 Created – New resource made 🆕
400 Bad Request – Invalid input ⚠️
401 Unauthorized – Need credentials 🔒
404 Not Found – Resource missing ❓
500 Server Error – API issue 💥
7
3
1
4
2
6
5
8
9
Postman – Your API Playground
Postman lets you:
●Send and test HTTP requests
●Automate tests and collections
●Document your APIs
●Simulate environments
8
3
1
4
2
6
5
7
9
Demo
8
3
1
4
2
6
5
7
9
●https://jsonplaceholder.typicode.com/posts
●https://library-api.postmanlabs.com/books
9
3
1
4
2
6
5
7
8
Create an endpoint for your app
Example scenario: Student registration system
POST /api/students Add student
→
GET /api/students Get all students
→
GET /api/students/{id} Get specific student
→
PUT /api/students/{id} Update student info
→
DELETE /api/students/{id} Remove student
→
Building a Custom API Endpoint
9
3
1
4
2
6
5
7
8
●Use clear, descriptive endpoints
●Return consistent JSON responses
●Include proper status codes
●Document your API
(Swagger / Postman Docs)
●Version your API: /api/v1/
Tips for Designing Good APIs
9
3
1
4
2
6
5
7
8
GraphQL vs REST
Feature REST GraphQL
Data Fetching Multiple endpoints Single endpoint
Response Size Fixed Flexible
Caching Simple Complex
Use Case Simpler apps Dynamic queries
9
3
1
4
2
6
5
7
8
●https://restfulapi.net/
●https://graphql.org/learn/
●https://developer.mozilla.org/en-US/docs/Web/HT
TP/Methods
●https://learning.postman.com/
●https://nodejs.org/docs/latest/api/
Tips for Designing Good APIs
9
3
1
4
2
6
5
7
8
Contact Details
Phone :
yegon@datany.online
254712 269 086
Nairobi, Kenya
Address :
Email :
Thank
you
https://gideonyegon.vercel.app

Understanding APIs: API types and custom Endpoint creation