What makes APIs tricky when you’re just starting out?

When I first got into APIs, I remember feeling stuck. Everyone was talking about endpoints, requests, responses, headers, methods, but where could I actually practice without breaking something real?

I wanted to experiment, make mistakes, and see how APIs really worked and that’s exactly why I built RESTful-Booker: a buggy little API playground that resets every 10 minutes. It’s designed so you can experiment, make mistakes, and see how APIs behave in practice.

For example, if you send a GET request to /booking/1, you’ll get a booking record in JSON. Change it to /booking/2, and you’ll get different data in the same structure. Try an ID that doesn’t exist, and you’ll see yet another response. These kinds of experiments help you build an intuition for how APIs work — consistent rules, changing content.

So here’s a practical challenge to help you try it out for yourself.

Your Task

  1. If you haven’t already, install Postman so you can build and send HTTP requests.

  2. Open Postman and send a GET request to the RESTful-Booker API. Use the API documentation to find the correct endpoints:

    • GetBookingIds – returns a list of booking IDs.

    • GetBooking – returns details for a specific booking.

  3. Review the response you get back:

    • What’s in the headers?

    • What’s the status code?

    • How is the body structured?

  4. Experiment further:

    • Change the identifier in the URI (e.g. /booking/2 or /booking/99).

    • Switch the method from GET to POST. What happens?

Reflect & Share

As you work, consider:

  • What happens when you request all bookings versus a single booking?
  • How does the response body stay the same in structure but differ in data?
  • What changes when you adjust the identifier in the URI?

Post your results in reply to this thread. Did you get the response you expected? Did anything surprise you? Screenshots are welcome, and let me know if you got stuck.

Helpful links:

4 Likes

@mwinteringham,

I used to find APIs really confusing. I knew the idea of requests and responses in theory, but it didn’t really click until I actually sent some calls and saw what came back.

I tried the RESTful-Booker challenge in Postman today, and things finally started to make sense:

GET /booking gave me a simple list of IDs.

GET /booking/1 returned booking details in JSON, and changing it to /booking/2 showed different data in the same format. That consistency really helped me understand how the system works.

Using /booking/9999 got me a “not found” response, which was an uncomplicated but effective demonstration of how the APIs behave in the absence of data.

I obtained an error after changing the method on the same endpoint from GET to POST. For some odd reason, it seemed reassuring it showed that there could be rules and that the method could matter.

1 Like