Embarking on the journey into the tech universe can be both exhilarating and a tad bit overwhelming, especially for someone like me – a tech enthusiast navigating the world of APIs. Recently, I had the incredible opportunity to attend the API 101 Workshop hosted by @supunsathsara at NIBM Galle. The promise of unraveling the mysteries behind APIs and delving into hands-on coding had me buzzing with anticipation. In this blog, I share my firsthand experience, the highlights, and the tech-filled adventure that unfolded during the workshop. Let's dive in!
Simplifying the API Lifecycle
At the core of Postman's appeal is its ability to simplify the entire API lifecycle. Whether you're a seasoned developer or just starting, Postman streamlines the process of API creation, making it a breeze to achieve better and faster results. The journey begins with an exploration of the foundational HTTP methods — GET, PUT, and DELETE.
Uncovering New Insights
As an attendee at the API 101 Workshop, one of the highlights that got everyone buzzing with excitement was our playful exploration of the /joke
endpoint in the API playground. Let me break it down in simple terms.
First things first, we kicked off our journey by forking the collection & checking out the Documentation.
Now, the real fun began with the endpoint URL: https://api101.up.railway.app/. Cool, right? But what made it even cooler were the paths we could take:
/joke
: Where the magic of the Jokes API unfolded.
/quote
: For our dose of wisdom from the Quotes API.
/book
: Taking a dive into the world of Books API.
What struck me was the flexibility – all paths could handle the entire squad of requests, be it GET, POST, PUT, or DELETE. No limits!
But the real star of the show for us was the /joke endpoint. It became more than just a tool; it was our canvas for creativity. We added our own jokes, shared laughs, and created a virtual space where humor brought us all together.
GET Request: Getting a Joke
So, the GET request was like our magic wand to conjure up some laughs. We learned that by default, there are six jokes, each with its unique ID [1-6]. To grab a random joke, we just hit {base_url}/joke
. Simple, right? If we wanted a specific one, we could call it by its ID, like {base_url}/joke/{id of joke}
. For example, {base_url}/joke/3
. No need for brackets in the path. It was like having a joke menu – choose random or go specific!
POST Request: Adding a New Joke
Now, the POST request was where the fun really kicked in. We could become joke creators! We hit {base_url}/joke, tossed our new joke into the body tab, selected JSON, and voila – a new joke was born! Our example body looked something like this:
{
"author": "madubashini gamage",
"joke": "It had too many •commitment issues and kept saying, It's not you, it's a runtime error",
"source": "nibm.lk"
}
The cool part? We got an ID in return, like our joke's birth certificate, and we could use that to update the joke later.
PUT Request: Updating a Joke
PUT was like the editor's desk. We went to {base_url}/joke
, threw in the updated data, making sure to change the ID to the one we got during the POST request. It was like giving our joke a makeover. The body looked something like this:
{
"id": "4513",
"author": "P M Gamage",
"joke": "Why did the programmer break up with their coffee?It had too many Java issues and they needed
something with better exception handling!",
"source": "API101 Workshop"
}
Easy peasy! We edited without breaking a sweat.
DELETE Request: Bidding Farewell to a Joke
Last but not least, DELETE. Sometimes, we had to say goodbye to a joke. It was as simple as hitting {base_url}/joke/{id of joke}
, like cleaning up our joke collection. For example, {base_url}/joke/4604
. No more jokes were harmed in the making of this API adventure!
So, there you have it – the GET, POST, PUT, and DELETE dance in our journey with the Joke API. We laughed, created, updated, and bid farewell, all in the name of tech fun! 🚀🤣
Gratitude for Guidance
A special note of gratitude goes to our Postman Student Expert, Mr. Savindu Supun Sathsara. His expert guidance has been instrumental in navigating the complexities of Postman, making the learning journey both enjoyable and educational.
In summary our exploration of Postman today has been a chapter in our journey of API learning. As we continue to uncover the possibilities offered by this tool our experience, with GET, PUT and DELETE methods highlights the role that Postman plays in shaping the future of API development.
🚀🌐✨
Top comments (0)