Create An Automated API Check That Asserts The Body Of A Response

Wednesday, 16th February 2022
Mark Winteringham
Mark Winteringham


Using restful-booker, send an HTTP request to create a booking and then assert that the correct details are returned in the HTTP response. For example, if you set the first name as "Mark", then HTTP response will come back with a booking that has a first name of "Mark"


  • You can get more information about creating a booking in the restful-booker API docs.
  • Restful-booker resets every ten minutes. Meaning you cannot rely on stored bookings from the past.

Learning Outcomes

  • Construct an automated API check that can assert an HTTP response body


Whilst this challenge is language agnostic (you can complete it using any tool or language you want) you will need to ensure all necessary SDKs and libraries are installed.


You can learn more about API automation in the API automation topic page. Here are some additional resources:



Practise sites

  • - A practise API that contains documentation (and bugs to find). An excellent place to start your API testing against


  • API Frameworks - A compilation of different API frameworks built in different languages that can be used to kickstart an API automation framework


  •  Testing Web APIs by Mark Winteringham - A comprehensive book that covers a range of API testing activities, including automation


View Solutions