API & HTTP Status Code
Tags: ibbus, api, statuscode, http
Published: 2024-03-05 10:17:08

API stands for Application Programming Interface. It works as an interface for communication between two applications.

**RESTful APIs** - Representational State Transfer is a type of web API that is designed to be lightweight, scalable, and flexible. It is based on the principles of HTTP, and it allows clients to access and manipulate resources using HTTP verbs (GET, POST, PUT, DELETE, etc.) and standard HTTP response codes.

**SOAP APIs** - Simple Object Access Protocol) is a secure way to build APIs, and it works by encoding data in XML format.

**WebSocket APIs** - The WebSocket API invokes your backend based on the content of the messages it receives from client apps.


**GraphQL APIs** - Query language for your API and a server-side runtime for executing queries using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.

**Open APIs** - Also called public API, is an application programming interface made publicly available to software developers. Open APIs are published on the internet and shared freely, allowing the owner of a network-accessible service to give universal access to consumers.

**Library-Based APIs** - A library is a collection of code that does a job (or a bunch of related jobs). A library just looks like a bunch of code. An API is the interface you use to interact with another system.

**Internal APIs** - Also called private APIs, are used within organizations to facilitate communication between different components or services of an application. These APIs are not exposed to external developers and are designed for internal use only.

---------------------------------------------------

An HTTP status code is a message a website's server sends to the browser to indicate whether or not that request can be fulfilled

`1XX: Informational`
Is a temporary status code which means that the server has received the request and is continuing the process

100 Continue

101 Switching Protocols

102 Processing request

103 Early Hints

`2XX: Success`
This means that the request was successful and the browser has received the expected information

200 OK

201 Created

202 Accepted

203 Non-Authoritative Information

204 No Content

205 Reset Content

206 Partial Content

207 Multi-Status

208 Already Reported

226 IM Used

`3XX: Redirection`
The type of status means you have been redirected and the completion of the request requires further action, not necessarily from your side

300 Multiple Choices

301 Moved Permanently

302 Found

303 See Other

304 Not Modified

305 Use Proxy

306 Switch Proxy

307 Temporary Redirect

308 Permanent Redirect

`4XX: Client Error`
When the website or the page could not be reached and either the page is unavailable or the request contains bad syntax

400 Bad Request

401 Unauthorized

402 Payment Required

403 Forbidden

404 Not Found

405 Method Not Allowed

406 No Acceptable

407 Proxy Authentication Required

408 Request Timeout

409 Conflict

410 Gone

411 Length Required

412 Precondition Failed

413 Payload Too Large

414 URI Too Long

415 Unsupported Media Type

416 Range Not Satisfiable

417 Expectation Failed

418 I'm a Teapot

421 Misdirected Request

422 Unprocessable Entity

423 Locked

424 Failed Dependency

425 Too Early

426 Upgrade Required

428 Precondition Required

429 Too Man Requests

431 Request Header Fields Too Large

451 Unavailable For Legal Reasons

`5XX: Server Error`
While the request might be valid, the server could not complete the request. These kinds of errors are mostly caused due to problems internally within the server.

500 Internal Server Error

501 Not Implemented

502 Bad Gateway

503 Service Unavailable

504 Gateway Timeout

505 HTTP Version Not Supported

506 Variant Also Negotiates

507 Insufficient Storage

508 Loop Detected

510 Not Extended

511 Network Authentication Required

---------------------------------------------