I'm attempting to create some API tests to assist with getting familiar with API automation and I'm using the really helpful Restful-Booker API for this. The API documentation is also here.

However I’m having an issue with the DELETE request as given below

enter image description here

I’ve initially created a booking, then I’m looking to delete it but whenever I run the request through Postman I get a 403 Forbidden error as below.

enter image description here

Would someone be able to point me in the direction where I may be going wrong with this.

up vote 4 down vote accepted

You need to provide token generated create Token API here in header under cookie field.

and URL used in not as mentioned in API

https://restful-booker.herokuapp.com/booking/{bookingID}

Please check the screenshot here.

enter image description here

enter image description here

New contributor
Sid is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Hi Sid, thanks for your comment. How do I obtain the cookie from the "create booking API? – Andy Tilston Sep 14 at 10:23
  • Hi @Andy use this API to get the token for your User restful-booker.herokuapp.com/apidoc/… – Sid Sep 14 at 10:30
  • Thanks Sid. And then do I then need to add this token when I create a booking, and then delete it later on? If you could provide screenshots of the flow you used that would help with my understanding – Andy Tilston Sep 14 at 10:36
  • I think only delete requires the token and create booking does not has token in body, it requires all booking related data in body. I have attached screenshot for token creation and my bad i have mentioned there token generated in create booking API, it is separate API as mentioned in above comments. [edited my answer as well :) ] – Sid Sep 14 at 10:49
  • That's great, thanks Sid. I've now been able to work this out. Out of interest what's the reasoning behind having to pass these tokens around? – Andy Tilston Sep 14 at 10:50

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.