API 101 USING POSTMAN
Tags: postmanstudent, postmanapi, girlscript
Published: 2022-04-30 19:57:31

**Hello Folks, Welcome to your Own Blog, Introduction To Api's Using Postman. Together we will learn and explore more about Api's using Postman.**

**Let's Understand What's an API?:**
Understand it by Considering it as a digital restaurant. It acts like a waiter your role is like a client who orders Something via Waiter and it Sends the request to the Server and gives output Accordingly.
**Now In Technical Means:**
* Application Programming Interface (APIs) allow Services to Communicate with each other.
* The Software has become more complex and Collaborative over the years. Developer no Longer need to create service From scratch.
* APIs allow developers to access data from a service (like Google or Twitter) without any knowledge of how the codebase has been implemented.
* There is an API for everything like the cat API, OpenWeatherMap, Genius, Discord, Youtube-to-MP3, etc.

**Now, Coming to postman API:**
Postman is scalable API testing tool that Quickly Integrates into CI/CD pipeline. It is collaborative API development platform that simplifies creating using, and testing APIs with a UI. It has become Much Easier to work with URLs using postman instead of doing tedious tasks via command lines.
**Here Is the View Of Postman:**
![Postman](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/815e0siibsxoqfhd4yk3.png)
**Essentials To Retrieve and Update API Data:**
```
Methods, Addresses, Parameters, Authorization, Body Data
```
**Request and Responses: We interact with api's using 3 ingredients that help us to make requests:**

```
Method (Get, Post, etc), Address/Endpoint(URL), Path
```
![Postman](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1yo7x85mpg01e56us9f.png)
**We Build Our Requests By Specifying Details Like:**
`Parameters (In the Query), Authorization, Headers and Body (Data Types)`
So What is the Point even after doing a lot many things we don't get output, right?
**Responses Elements**
`Status Codes(200 OK, 201 Created,404 Not Found), Headers, Accessing Body data`
**Now Let's Do Some Practical Implementation:**
Implementation Of Joke API:- Copy Endpoint URL Paste On Get Data, See Output:- Hello World!
**GETs Method -**
By default, we have 4 jokes with id [0-3]
To get a random joke: {base_url}/joke
To get a specific joke: {base_url}/joke/{id of joke}

![Postman](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/797y2as7voyvfii5ph2o.png)
![Postman](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91p0ba8douerq1rb9n85.png)
**Post Method -**
{
        "id": "1",
        "author": "Ali Mustufa",
        "joke": "Bugs are features",
        "source": "iali.dev"
}

![Post](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tbzh1mpxi4fm8awlzv8z.png)
Here View Of Joke Api:-
![Post](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wypti32grck1y9zydu7r.png)
**Put (Update Joke)**
{
        "id": "1",
        "author": "Ali Mustufa",
        "joke": "Bugs are updated features",
        "source": "iali.dev"
}

![Put](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00vs0faae38f5uyms788.png)
Here View Of Updated Joke Api:-
![Put](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbv57qv2sll099ypnm21.png)
**Delete (Joke):-**
To delete a joke: {base_url}/joke/{id of joke}

![Delete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojyq06ujmwiejs3hpdrv.png)
Here is The View After Delete:-
![Delete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdx7m2bol77kjtyow08f.png)
**I Hope You All Got A Basic Understanding Of Api's
Thank You So Much!!!**
Special Thanks To Ali Mustufa Sir