Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to REST APIs

Introduction to REST APIs

Introduction to REST APIs

This workshop will teach you the fundamentals of REST APIs, their architecture, and their use in web applications. You will also learn about key concepts such as HTTP methods and request/response. The workshop will be hands-on, and you will use Postman to explore these different concepts.

The workshop is designed for beginners, so there will be a short introduction to APIs. However, no prior experience with REST APIs is required.

This workshop was part of an API workshop series being done collaboratively with the Google Developer Students Club at Moi University.

Event Link: https://gdsc.community.dev/events/details/developer-student-clubs-moi-university-presents-introduction-to-rest-api/

Clifford Ouma

March 01, 2023
Tweet

More Decks by Clifford Ouma

Other Decks in Programming

Transcript

  1. Agenda go.postman.co/build Recap intro to APIs? 1. Introduction to RESTful

    APIs 2. Building RESTful requests 3. Working with responses 4. Demo using HTTP requests 5. Conclusion 6.
  2. Interface I Allow control of interaction with obstruction UI is

    for users while API is for programmer Allows programmer interact with data without worrying about implementation
  3. There’s an API for everything Everything The Cat API OpenWeatherMap

    Twilio Discord Youtube-to-MP3 Spotify Twitter Facebook Google And so many more!
  4. More than 500,000 organizations & 13 Million developers use Postman

    98% of Fortune 500 Organizations use Postman 65% of Global 2000 Organizations use Postman Postman is a collaborative API development platform that simplifies creating, using, and testing APIs with a UI What is Postman?
  5. Introduction to REST APIs REST defined a clear way of

    working with Web APIs APIs that use REST architecture are called RESTful APIs
  6. Making Requests Method (GET, POST, etc) Address/Endpoint (URL) Path The

    three ingredients to make a request: How we interact with the API
  7. Requests - Methods and Endpoints Method GET Retrieve information POST

    Send information PUT/PATCH Update information DELETE Delete information Bare minimum for a request
  8. Requests - Methods and Endpoints Method GET Retrieve information POST

    Send information PUT/PATCH Update information DELETE Delete information address of the server Bare minimum for a request https://www.google.com/search The scheme of the request. Defines how to communicate Host Path Protocol destination where request can be heard and executed
  9. Specifying Detail Parameters Start with ? and have key and

    value Query params and search params Building your requests
  10. Specifying Detail Parameters Start with ? and have key and

    value Query params and search params Authorization Building your requests
  11. Specifying Detail Parameters Start with ? and have key and

    value Query params and search params Authorization Headers and body Provides metadata and more info Building your requests
  12. Requests - Body The data payload Optional, but often supplied

    with POST and PUT requests Data types form data JSON text HTML XML files GraphQL … and more! { “name”: “Jane Doe”, “email”: “[email protected]”, “birthYear”: 1970 } JSON
  13. Receiving Responses Status codes (200 OK, 201 Created, 404 Not

    found) Headers Accessing body data Response elements
  14. Receiving Responses They explain what happened on the server side

    2xx (Success): e.g 200(Ok) 3xx (Redirection) e.g 301(Moved) 4xx (Client Error) e.g 404 (Not found) 5xx (Server Error) e.g 500(Internal Error) Status Codes Examples:
  15. Why REST APIs are popular Simple and standardized Easy to

    understand & industry standard Scalable and Stateless Modifications & no worry on about state 1. 2.
  16. Why REST APIs are popular Simple and standardized Easy to

    understand & industry standard Scalable and Stateless Modifications & no worry on about state High performance/Caching Reduced number of requests 1. 2. 3.
  17. Continue Learning APIs as a Student Expert Student Expert certification

    indicates that you are proficient in the essential skills involved in building and testing API requests in Postman, including: Sending more sophisticated requests in Postman. Editing documentation for a collection. Writing basic test scripts. Running collections, passing data between requests, and scripting request execution order. Have the option to become a Student Leader in your community
  18. Q&A