<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kevin Kipngeno </title>
    <description>The latest articles on DEV Community by Kevin Kipngeno  (@kipngeno7664).</description>
    <link>https://dev.to/kipngeno7664</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F962828%2F9313b5ef-a725-4f9d-86ad-58c95f474ed6.png</url>
      <title>DEV Community: Kevin Kipngeno </title>
      <link>https://dev.to/kipngeno7664</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kipngeno7664"/>
    <language>en</language>
    <item>
      <title>POSTMAN API</title>
      <dc:creator>Kevin Kipngeno </dc:creator>
      <pubDate>Wed, 02 Nov 2022 07:29:09 +0000</pubDate>
      <link>https://dev.to/kipngeno7664/postman-api-195l</link>
      <guid>https://dev.to/kipngeno7664/postman-api-195l</guid>
      <description>&lt;p&gt;API can be compared to a waiter in a restaurant, who takes requests from clients/customer to a chef in the kitchen, then gets back to the customer with feedback, either with the food ordered present or not. Same way, API acts as a link between a user of a program and a server.&lt;br&gt;&lt;br&gt;
Client/customer = user&lt;br&gt;
API = waiter&lt;br&gt;
Chef = Server&lt;br&gt;
API full form is Application Programming Interface.&lt;/p&gt;
&lt;h2&gt;
  
  
  POSTMAN APIs
&lt;/h2&gt;

&lt;p&gt;Postman is an API platform used for building &amp;amp; testing APIs. It provide organized collection of data &amp;amp; test of APIs graphically (GUI) with numbers of HTTP requests like GET, POST, PUT/PATCH, POST and DELETE.&lt;br&gt;
GET - Retrieve information&lt;br&gt;
POST - send information&lt;br&gt;
PUT/PATCH- Update information&lt;br&gt;
DELETE- delete information&lt;/p&gt;
&lt;h2&gt;
  
  
  NEW TO APIs?
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Introduction to APIs with Postman
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Create Postman Account
&lt;/h3&gt;

&lt;p&gt;The first step is to create a Postman account. If you already own an account , then you can skip this step. &lt;br&gt;
To create a new Postman account , you need to follow the following steps;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://identity.getpostman.com/signup"&gt;https://identity.getpostman.com/signup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Enter your email , username &amp;amp; password and click on 'create account'&lt;/li&gt;
&lt;li&gt;After that you need to enter your name &amp;amp; role (like student / developer)&lt;/li&gt;
&lt;li&gt;Then it will ask you to invite your team. Skip this process by clicking on 'Continue without team'&lt;/li&gt;
&lt;li&gt;Verify your email&lt;/li&gt;
&lt;li&gt;Done , you have successfully created a Postman account&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Getting Started with APIs
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Forking Collection In Postman
&lt;/h2&gt;

&lt;p&gt;Enter a label to identify your project like 'APITut' and select 'My Workspace' from workspace and click on Fork Collection to fork the collection.&lt;br&gt;
Go to &lt;a href="https://bit.ly/postman-demo"&gt;https://bit.ly/postman-demo&lt;/a&gt;. It will open a collection in Postman. Choose 'Basics of API'  and click on Fork to fork it&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FvyqZu41--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnnpwjtnm8q8pkoty5fp.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FvyqZu41--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnnpwjtnm8q8pkoty5fp.PNG" alt="Fork collection" width="666" height="526"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;Documentation is one of the most important part to be read by a developer SO that they can understand how to use the product/services. In some of the program , it is also called as ReadMe&lt;/p&gt;
&lt;h2&gt;
  
  
  Endpoint URL
&lt;/h2&gt;

&lt;p&gt;In this tutorial , we will use &lt;a href="http://postmanstudent.herokuapp.com"&gt;http://postmanstudent.herokuapp.com&lt;/a&gt; as our testing url on which we will perform various HTTP requests. Using this url , we can perform api testing on three path , i.e /joke , /book &amp;amp; /quote. In this tutorial i will be using joke so our main url will be &lt;a href="http://postman-student.herokuapp.com/joke"&gt;http://postman-student.herokuapp.com/joke&lt;/a&gt; &lt;/p&gt;
&lt;h2&gt;
  
  
  GET Request In Postman
&lt;/h2&gt;

&lt;p&gt;Lets start playing with GET request. From the collection , expand your main project (Basic of API) and click on GET Data. After that enter &lt;a href="https://postman-student.herokuapp.com/joke"&gt;https://postman-student.herokuapp.com/joke&lt;/a&gt; as request url  , choose GET as method and click on Send button. At the bottom you can see a Body section which displays result in brackets format. This format is JSON format which is known as JavaScript Object Notation.  In maximum cases all the output of APIs are returned as JSON format.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S_SBppPM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apyejy6bgpo9pxsqp9r8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S_SBppPM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apyejy6bgpo9pxsqp9r8.PNG" alt="Get request" width="745" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8JjEWwwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whw4xza3fapq29j8a0ys.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8JjEWwwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whw4xza3fapq29j8a0ys.PNG" alt="Getting request" width="720" height="202"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  POST Request In Postman
&lt;/h2&gt;

&lt;p&gt;Now lets try POST Request. Click on three dots on corner of collection &amp;amp; click on Add Request&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v1Jltia6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocjgigr1seuv9b6x9eoa.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v1Jltia6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocjgigr1seuv9b6x9eoa.PNG" alt="post request" width="482" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will create a new request. Name it anything like POST (Add). Using POST method , we can add jokes. Lets try it&lt;/p&gt;

&lt;p&gt;In the request url , enter &lt;a href="https://postmanstudent.herokuapp.com/joke"&gt;https://postmanstudent.herokuapp.com/joke&lt;/a&gt; and select POST as method.  Now select Body -&amp;gt; raw and select JSON from dropdown.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4YUwOb0E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/su2iapbiij4fjb8vzl0w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4YUwOb0E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/su2iapbiij4fjb8vzl0w.PNG" alt="posting request" width="729" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In its content , enter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  {
        "id": 100,
        "author": "ND",
        "joke": "New Joke",
        "source": "kipngeno.org"
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Modify the above code of your choice. Now click on send. You will see the following response&lt;/p&gt;

&lt;p&gt;This has assigned us a random id '1237'. By sending GET request as &lt;a href="http://postman-student.herokuapp.com/joke/1237"&gt;http://postman-student.herokuapp.com/joke/1237&lt;/a&gt; , we can access this joke&lt;/p&gt;

&lt;h2&gt;
  
  
  PUT Request In Postman
&lt;/h2&gt;

&lt;p&gt;Using PUT request , we can modify our existing data. Lets create a new request .Click on three dots on corner of collection &amp;amp; click on Add Request. Name it as PUT (Update).&lt;br&gt;
In the request url , enter &lt;a href="https://postmanstudent.herokuapp.com/joke"&gt;https://postmanstudent.herokuapp.com/joke&lt;/a&gt; and select PUT as method.  Now select Body -&amp;gt; raw and select JSON from dropdown.In its content , enter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 {
        "id": 1237,
        "author": "ND",
        "joke": "New Joke Updated",
        "source": "kipngeno.org",
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code , modify id with the id of the joke you want to modify. Also you can modify author , joke and source. After that click on Send.&lt;br&gt;
You can see a text with status code 204 : No content. It means your update has been successfully pushed. Now to see whether data is changed or not , run GET request with your id.&lt;/p&gt;

&lt;p&gt;So , the data is changed that means our request was executed successfully.&lt;/p&gt;

&lt;h2&gt;
  
  
  DELETE Request In Postman
&lt;/h2&gt;

&lt;p&gt;Using DELETE request , we can delete our joke (completely with author  &amp;amp; source). Lets try this.&lt;br&gt;
Create a new request .Click on three dots on corner of collection &amp;amp; click on Add Request. Name it as DELETE.&lt;br&gt;
In the request url , enter &lt;a href="https://postmanstudent.herokuapp.com/joke/yourid"&gt;https://postmanstudent.herokuapp.com/joke/yourid&lt;/a&gt; (for example : &lt;a href="https://postman-student.herokuapp.com/joke/1237"&gt;https://postman-student.herokuapp.com/joke/1237&lt;/a&gt; ) and select DELETE as method. Replace your id with the id of the joke you want to delete. Click on send button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dt2A8WeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfr7k756uaz5ci7rid5r.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dt2A8WeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfr7k756uaz5ci7rid5r.PNG" alt="delete request" width="531" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our joke with id 1237 deleted successfully.&lt;/p&gt;

</description>
      <category>postmanstudent</category>
      <category>postmanapi</category>
    </item>
  </channel>
</rss>
