Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
100 views
Api Cheatsheet
js notes
Uploaded by
21052473
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save api cheatsheet For Later
Download
Save
Save api cheatsheet For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
100 views
Api Cheatsheet
js notes
Uploaded by
21052473
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save api cheatsheet For Later
Carousel Previous
Carousel Next
Save
Save api cheatsheet For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 9
Search
Fullscreen
APIs fy> CODE HELPIn this Cheatsheet, we will cover the basics of API. We will provide examples to help you understand how API’s work and how to use them in your own web development projects. Whether you are a beginner or an experienced developer, this PDF can serve as a useful reference guide. CaPI An API, or Application Programming Interface, is a set of rules and protocols for building and interacting with software applications. It allows different software systems to communicate with each other, enabling them to share data and functionality. This allows developers to access the functionality of a certain software application or system without having to understand its underlying code or implementation. An example of an API is the Facebook API, which allows developers to access and interact with the functionality of the Facebook platform, such as posting status updates, retrieving user information, and managing ad campaigns. Another example is the Google Maps API, which allows developers to embed maps and location-based functionality in their own websites and apps. How an API Works: APIs act as a bridge between applications and web servers, processing data transfer between systems. When a client application initiates an API call, also known as a request, it is sent to the web server via the API's Uniform Resource Identifier (URI) and includes a request verb, headers, and sometimes a request body. The API then processes the request and may make a call to an external program or web server for the requested information.The server responds with the requested data, which the API then forwards to the initial requesting application. This process of requests and responses all happens through the API. Unlike user interfaces which are designed for human use, APIs are designed for use by computers or applications. REST API: (Representational State Transfer) REST (Representational State Transfer) is a type of web architecture and a set of constraints to be used when creating web services. RESTful API (Application Programming Interface) is an API that conforms to the REST architectural style and constraints, and it is typically used to make requests to retrieve or update data on a web server. A RESTful API uses HTTP requests to POST (create), PUT (update), GET (read), and DELETE (delete) data. A RESTful API also returns a response in a standard format, typically JSON or XML, and uses standard HTTP status codes to indicate the status of the request. RESTful APIs are popular because they are simple to understand and easy to use, and they work well with the HTTP protocol that the internet is built on. Additionally, RESTful APIs are often faster and more lightweight than their SOAP (Simple Object Access Protocol) counterparts because they use smaller message formats. RESTful API's have become a popular way for systems to expose databases through HTTP(S) following CRUD operations (Create, Read, Update, Delete), and return JSON or XML as responses, it's also widely used in microservices, mobile and web applications, IoT, and many more. REST requires that a client make a request to the server in order to retrieve or modify data on the server.A request generally consists: ¢ An HTTP verb, which defines what kind of operation to perform. « Aheader, which allows the client to pass along information about the request. « Apath to a resource. « Anoptional message body containing data. CRUD: (Create Read Update Delete) CRUD stands for Create, Read, Update, and Delete, which are the four basic operations that can be performed on data in a database. These operations are often used to interact with databases through APIs (Application Programming Interfaces). « Create: This operation is used to add new data to the database. It is typically performed using the HTTP POST method and is used to create new resources. e Read: This operation is used to retrieve data from the database. It is typically performed using the HTTP GET method and is used to read existing resources. ¢ Update: This operation is used to modify existing data in the database. It is typically performed using the HTTP PUT method and is used to update existing resources. ¢ Delete: This operation is used to remove data from the database. It is typically performed using the HTTP DELETE method and is used to delete resources.CRUD operations are typically implemented in RESTful APIs, but they can also be used in other types of APIs. These operations can be used to expose the data in a database to other systems, such as a mobile app or a web application, that can use the data to provide a service to end-users. HTTP Verbs In the context of API (Application Programming Interface), HTTP verbs (or methods) are used to specify the type of action that the API client wants to perform on a resource. The most commonly used HTTP verbs in API are: ¢ GET: This verb is used to retrieve information from the server. It is the most common verb used to make a request to an API. It is considered safe, meaning that it should not have any side effects on the server or the data it serves. ¢ POST: This verb is used to submit information to the server. It is typically used to create new resources. ¢ DELETE: This verb is used to delete resources. ¢ PUT: This verb is used to update existing resources. It replaces the entire resource, unlike the PATCH verb which modifies only the fields sent in the request. « PATCH: This verb is used to partially update a resource. It is used to modify only the fields sent in the request and it's usually used when you don't want to replace all the resource’s attributes.¢ PUT vs PATCH: PUT method uses the request URI to supply a modified version of the requested resource which replaces the original version of the resource, whereas the PATCH method supplies a set of instructions to modify the resource. ¢ HEAD: This verb is similar to GET, but it only returns the headers of the response, without the body. ¢ OPTIONS: This verb is used to retrieve the allowed actions on a resource. « CONNECT: Connect request establishes a tunnel to the server identified by a specific URI. A good example is SSL tunnelling. « TRACE: The Trace method performs a message loop-back test along the path to the target resource, to provide a useful debugging mechanism. It allows clients to view whatever message is being received at the other end of the request chain so that they can use the info for testing or diagnostic functions. These verbs are part of the HTTP protocol, and are commonly used in RESTful (Representational State Transfer) APIs, which are built on top of the HTTP protocol and are designed to be easily consumed by web and mobile applications.HTTP Status Codes HTTP status codes are three-digit numbers returned by an API (Application Programming Interface) to indicate the status of a request. These codes provide information about whether a request was successful or not, and they are an important part of the API development. The first digit of the status code specifies one of five standard classes of responses. Standard Classes: © 1xx: Informational responses. « 2xx: Successful responses. ¢ 3xx: Redirection responses. e 4xx: Client error responses. « 5xx: Server error responses. 1xx: Informational responses It indicates that the request was received and understood by the server and it’s continuing the process. ¢ 100: Continue. ¢ 101: Switching Protocols. ¢ 102: Processing. ¢ 103: Early Hints.2xx: Successful responses It indicates that the action requested by the client was received, understood, and accepted. 200: OK. 201: Created. 202: Accepted. 203: Non-Authoritative Information. 204: No Content. 3xx: Redirection responses Many of these 3xx status codes are used in URL redirection or it indicates the client must take additional action to complete the request. 301: Moved Permanently. 302: Found. 304: Not Modified. 305: Use Proxy. 307: Temporary Redirect. 308: Permanent Redirect.4oc Client error responses This status code is intended for situations in which the error seems to have been caused by the client. 400: Bad Request. 401: Unauthorized. 403: Forbidden. 404: Not Found. 406: Not Acceptable. 408: Request Timeout. 5xx: Server error responses It indicates that the server has encountered a situation where it doesn’t know how to handle a request. 500: Internal Server Error 501: Not Implemented 502: Bad Gateway 503: Service Unavailable 504: Gateway Timeout 505: HTTP Version Not Supported These are just a few examples of the many HTTP status codes that can be returned by an API. It's important to understand the meaning of each code and to handle them appropriately in the client application. The HTTP status codes are standardized and are used as a way for the server to communicate with the client about the outcome of a request.
You might also like
API Pentesting
PDF
No ratings yet
API Pentesting
27 pages
Lecture 1 - Introduction To Web Architecture
PDF
No ratings yet
Lecture 1 - Introduction To Web Architecture
23 pages
Auth API Documentation
PDF
No ratings yet
Auth API Documentation
6 pages
An Introduction To API Gateway in NestJS With Microservices and Rest APIs - Part 01 - by Marcos Henrique Da Silva - Medium
PDF
No ratings yet
An Introduction To API Gateway in NestJS With Microservices and Rest APIs - Part 01 - by Marcos Henrique Da Silva - Medium
11 pages
ETradeFinancial-API Technical Documentation
PDF
No ratings yet
ETradeFinancial-API Technical Documentation
146 pages
GET - Hands-On RESTful Web Services With Go - Second Edition PDF
PDF
No ratings yet
GET - Hands-On RESTful Web Services With Go - Second Edition PDF
1 page
Lecture 08 Web Services
PDF
No ratings yet
Lecture 08 Web Services
79 pages
Web Technology Notes
PDF
No ratings yet
Web Technology Notes
102 pages
ARB Payment Gateway 3.3.0.ARB - REST API Integration Guide - V1.10
PDF
No ratings yet
ARB Payment Gateway 3.3.0.ARB - REST API Integration Guide - V1.10
58 pages
X Internet
PDF
No ratings yet
X Internet
17 pages
Master Frontend Ebook
PDF
No ratings yet
Master Frontend Ebook
733 pages
An Introduction To Apollo Federation in NestJS - by Marcos Henrique Da Silva - Nov, 2022 - Medium
PDF
No ratings yet
An Introduction To Apollo Federation in NestJS - by Marcos Henrique Da Silva - Nov, 2022 - Medium
19 pages
Oracle Flexcube Restful Services Usage
PDF
No ratings yet
Oracle Flexcube Restful Services Usage
10 pages
REST API and Web Services
PDF
No ratings yet
REST API and Web Services
104 pages
Professional JavaScript for Web Developers 3rd Edition Nicholas C. Zakas - Instantly access the full ebook content in just a few seconds
PDF
100% (1)
Professional JavaScript for Web Developers 3rd Edition Nicholas C. Zakas - Instantly access the full ebook content in just a few seconds
62 pages
Full Stack UNIT 4
PDF
No ratings yet
Full Stack UNIT 4
50 pages
Node Cheat Sheet
PDF
No ratings yet
Node Cheat Sheet
6 pages
WS&SOA
PDF
No ratings yet
WS&SOA
54 pages
Symfony Book 2.8 PDF
PDF
No ratings yet
Symfony Book 2.8 PDF
223 pages
Javascript
PDF
No ratings yet
Javascript
62 pages
04 State Management
PDF
No ratings yet
04 State Management
35 pages
Documentation Postman SalesPad WebAPI Example Usage
PDF
No ratings yet
Documentation Postman SalesPad WebAPI Example Usage
16 pages
Java Script Basics
PDF
No ratings yet
Java Script Basics
114 pages
SimahPro Direct - API Integration V 0.2
PDF
No ratings yet
SimahPro Direct - API Integration V 0.2
9 pages
Chapter Six Java Web Technology
PDF
No ratings yet
Chapter Six Java Web Technology
44 pages
Introduction To Apis: William El Kaim Oct. 2016 - V 2.2
PDF
No ratings yet
Introduction To Apis: William El Kaim Oct. 2016 - V 2.2
85 pages
Unit V
PDF
No ratings yet
Unit V
34 pages
Java Servlets 110317050338 Phpapp01 PDF
PDF
No ratings yet
Java Servlets 110317050338 Phpapp01 PDF
57 pages
Simple Books API Document
PDF
No ratings yet
Simple Books API Document
3 pages
The Journey of A Request To The Backend
PDF
No ratings yet
The Journey of A Request To The Backend
10 pages
Aticara ByteStorm API Reference
PDF
No ratings yet
Aticara ByteStorm API Reference
35 pages
Full Download Learning JavaScript Design Patterns Addy Osmani PDF DOCX
PDF
100% (6)
Full Download Learning JavaScript Design Patterns Addy Osmani PDF DOCX
60 pages
Abstract Factory&Adapter
PDF
No ratings yet
Abstract Factory&Adapter
10 pages
Guide To Learn ASP - NET Core Web API
PDF
No ratings yet
Guide To Learn ASP - NET Core Web API
19 pages
Diffie-Hellman Case Study - 1DS18TE075
PDF
No ratings yet
Diffie-Hellman Case Study - 1DS18TE075
10 pages
Telecom Apis
PDF
No ratings yet
Telecom Apis
66 pages
3.EcmaScript 6 Overview
PDF
No ratings yet
3.EcmaScript 6 Overview
126 pages
Introduction To Drupal: Robert Castelo, CTO, Code Positive
PDF
No ratings yet
Introduction To Drupal: Robert Castelo, CTO, Code Positive
53 pages
Introduction To Redux
PDF
No ratings yet
Introduction To Redux
7 pages
Web Technologies (Unit-5)
PDF
No ratings yet
Web Technologies (Unit-5)
57 pages
Corba Case Study
PDF
No ratings yet
Corba Case Study
7 pages
WT Unit-1 To 5
PDF
No ratings yet
WT Unit-1 To 5
188 pages
Advantages Disadvantages: 3. Stateful Multilayer Inspection Firewall
PDF
No ratings yet
Advantages Disadvantages: 3. Stateful Multilayer Inspection Firewall
2 pages
Fundamental of Computer
PDF
No ratings yet
Fundamental of Computer
195 pages
10 Rest API Best Practices 1687451736
PDF
No ratings yet
10 Rest API Best Practices 1687451736
12 pages
Cloud Computing Notes
PDF
No ratings yet
Cloud Computing Notes
21 pages
What Is An IP Address
PDF
No ratings yet
What Is An IP Address
3 pages
CnMaestro 2.4.1 RESTful API
PDF
No ratings yet
CnMaestro 2.4.1 RESTful API
89 pages
Wildfly Swarm Users Guide
PDF
No ratings yet
Wildfly Swarm Users Guide
168 pages
I. Introduction - Metaverse Urbanism Book
PDF
No ratings yet
I. Introduction - Metaverse Urbanism Book
29 pages
Web Programming Fundamentals
PDF
No ratings yet
Web Programming Fundamentals
105 pages
Solution of IWT
PDF
No ratings yet
Solution of IWT
6 pages
Assignment API
PDF
No ratings yet
Assignment API
7 pages
18cs63 Web Technology and Its Applications Syllabus
PDF
No ratings yet
18cs63 Web Technology and Its Applications Syllabus
3 pages
Xss Cheat Sheet
PDF
No ratings yet
Xss Cheat Sheet
2 pages
Ajax Tutorial
PDF
100% (3)
Ajax Tutorial
5 pages
API Cheet Sheet
PDF
No ratings yet
API Cheet Sheet
9 pages
Api Guide
PDF
No ratings yet
Api Guide
26 pages
Understanding API: What Is An API?
PDF
100% (1)
Understanding API: What Is An API?
17 pages
API
PDF
No ratings yet
API
2 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
API Pentesting
PDF
API Pentesting
Lecture 1 - Introduction To Web Architecture
PDF
Lecture 1 - Introduction To Web Architecture
Auth API Documentation
PDF
Auth API Documentation
An Introduction To API Gateway in NestJS With Microservices and Rest APIs - Part 01 - by Marcos Henrique Da Silva - Medium
PDF
An Introduction To API Gateway in NestJS With Microservices and Rest APIs - Part 01 - by Marcos Henrique Da Silva - Medium
ETradeFinancial-API Technical Documentation
PDF
ETradeFinancial-API Technical Documentation
GET - Hands-On RESTful Web Services With Go - Second Edition PDF
PDF
GET - Hands-On RESTful Web Services With Go - Second Edition PDF
Lecture 08 Web Services
PDF
Lecture 08 Web Services
Web Technology Notes
PDF
Web Technology Notes
ARB Payment Gateway 3.3.0.ARB - REST API Integration Guide - V1.10
PDF
ARB Payment Gateway 3.3.0.ARB - REST API Integration Guide - V1.10
X Internet
PDF
X Internet
Master Frontend Ebook
PDF
Master Frontend Ebook
An Introduction To Apollo Federation in NestJS - by Marcos Henrique Da Silva - Nov, 2022 - Medium
PDF
An Introduction To Apollo Federation in NestJS - by Marcos Henrique Da Silva - Nov, 2022 - Medium
Oracle Flexcube Restful Services Usage
PDF
Oracle Flexcube Restful Services Usage
REST API and Web Services
PDF
REST API and Web Services
Professional JavaScript for Web Developers 3rd Edition Nicholas C. Zakas - Instantly access the full ebook content in just a few seconds
PDF
Professional JavaScript for Web Developers 3rd Edition Nicholas C. Zakas - Instantly access the full ebook content in just a few seconds
Full Stack UNIT 4
PDF
Full Stack UNIT 4
Node Cheat Sheet
PDF
Node Cheat Sheet
WS&SOA
PDF
WS&SOA
Symfony Book 2.8 PDF
PDF
Symfony Book 2.8 PDF
Javascript
PDF
Javascript
04 State Management
PDF
04 State Management
Documentation Postman SalesPad WebAPI Example Usage
PDF
Documentation Postman SalesPad WebAPI Example Usage
Java Script Basics
PDF
Java Script Basics
SimahPro Direct - API Integration V 0.2
PDF
SimahPro Direct - API Integration V 0.2
Chapter Six Java Web Technology
PDF
Chapter Six Java Web Technology
Introduction To Apis: William El Kaim Oct. 2016 - V 2.2
PDF
Introduction To Apis: William El Kaim Oct. 2016 - V 2.2
Unit V
PDF
Unit V
Java Servlets 110317050338 Phpapp01 PDF
PDF
Java Servlets 110317050338 Phpapp01 PDF
Simple Books API Document
PDF
Simple Books API Document
The Journey of A Request To The Backend
PDF
The Journey of A Request To The Backend
Aticara ByteStorm API Reference
PDF
Aticara ByteStorm API Reference
Full Download Learning JavaScript Design Patterns Addy Osmani PDF DOCX
PDF
Full Download Learning JavaScript Design Patterns Addy Osmani PDF DOCX
Abstract Factory&Adapter
PDF
Abstract Factory&Adapter
Guide To Learn ASP - NET Core Web API
PDF
Guide To Learn ASP - NET Core Web API
Diffie-Hellman Case Study - 1DS18TE075
PDF
Diffie-Hellman Case Study - 1DS18TE075
Telecom Apis
PDF
Telecom Apis
3.EcmaScript 6 Overview
PDF
3.EcmaScript 6 Overview
Introduction To Drupal: Robert Castelo, CTO, Code Positive
PDF
Introduction To Drupal: Robert Castelo, CTO, Code Positive
Introduction To Redux
PDF
Introduction To Redux
Web Technologies (Unit-5)
PDF
Web Technologies (Unit-5)
Corba Case Study
PDF
Corba Case Study
WT Unit-1 To 5
PDF
WT Unit-1 To 5
Advantages Disadvantages: 3. Stateful Multilayer Inspection Firewall
PDF
Advantages Disadvantages: 3. Stateful Multilayer Inspection Firewall
Fundamental of Computer
PDF
Fundamental of Computer
10 Rest API Best Practices 1687451736
PDF
10 Rest API Best Practices 1687451736
Cloud Computing Notes
PDF
Cloud Computing Notes
What Is An IP Address
PDF
What Is An IP Address
CnMaestro 2.4.1 RESTful API
PDF
CnMaestro 2.4.1 RESTful API
Wildfly Swarm Users Guide
PDF
Wildfly Swarm Users Guide
I. Introduction - Metaverse Urbanism Book
PDF
I. Introduction - Metaverse Urbanism Book
Web Programming Fundamentals
PDF
Web Programming Fundamentals
Solution of IWT
PDF
Solution of IWT
Assignment API
PDF
Assignment API
18cs63 Web Technology and Its Applications Syllabus
PDF
18cs63 Web Technology and Its Applications Syllabus
Xss Cheat Sheet
PDF
Xss Cheat Sheet
Ajax Tutorial
PDF
Ajax Tutorial
API Cheet Sheet
PDF
API Cheet Sheet
Api Guide
PDF
Api Guide
Understanding API: What Is An API?
PDF
Understanding API: What Is An API?
API
PDF
API