0% found this document useful (0 votes)
3 views2 pages

API Descriptive Sheet Deb

The document provides a comprehensive overview of APIs, explaining their definition, types (REST API vs RESTful API), and common HTTP methods. It also covers status codes, headers, JSON format, tools for testing APIs, and best practices for error handling and security. Additionally, it highlights the importance of API keys and debugging techniques.

Uploaded by

Debadutta Barik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

API Descriptive Sheet Deb

The document provides a comprehensive overview of APIs, explaining their definition, types (REST API vs RESTful API), and common HTTP methods. It also covers status codes, headers, JSON format, tools for testing APIs, and best practices for error handling and security. Additionally, it highlights the importance of API keys and debugging techniques.

Uploaded by

Debadutta Barik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Complete API Descriptive Sheet

1. What is an API?

API (Application Programming Interface) is a set of rules that allows two applications to talk to each other. It

acts as a messenger between client and server.

2. REST API vs RESTful API

REST API: Any API that follows REST principles.

RESTful API: An API that strictly adheres to REST design constraints like statelessness, uniform interface,

etc.

3. HTTP Methods

- GET: Retrieve data

- POST: Send new data

- PUT: Replace existing data

- PATCH: Update part of existing data

- DELETE: Remove data

4. Status Codes

- 200: OK (Success)

- 201: Created

- 400: Bad Request

- 401: Unauthorized

- 404: Not Found

- 500: Server Error

5. Headers & Body

Headers: Metadata like Content-Type, Authorization.

Body: Data sent (mainly in POST/PUT requests) usually in JSON format.


Complete API Descriptive Sheet

6. JSON & Query Params

JSON is the standard format for sending/receiving data.

Query params are added to URLs like ?city=delhi&units=metric

7. Tools Used

- Postman: GUI tool to test APIs

- fetch(): JavaScript method to call APIs

- async/await: Modern async handling in JS

8. Public APIs & Keys

APIs like OpenWeatherMap, NewsAPI, etc., often require API keys. Keys should be kept secret in production.

9. API Errors & Debugging

- Always check status codes

- Use console.log and catch blocks

- Validate input before making requests

10. Best Practices

- Always handle errors

- Use try/catch with async

- Validate user input

- Keep keys secure

- Test APIs with Postman before coding

You might also like