Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Documentation for the REST API
- This topic has 3 replies, 2 voices, and was last updated 2 years, 11 months ago by Loris Plasson.
- AuthorPosts
- November 20, 2021 at 9:21 am #1217422Loris PlassonParticipant
Hello, since the new version there is this line on the changelog (and an advanced tab in the settings).
4.1.0, Nov 19 2021
New: Implemented REST API. This will give developers more extensive control over the plugin data, help integrate third-party services, and build new frontend experiences for Hotel Booking in WordPress.Could someone tell me more about this interesting looking like feature? I did not see it mentionned anywhere on the documentation.
Regards,
Loris.November 29, 2021 at 3:01 pm #1223573Alex MParticipantDocumentation is in the progress.
Authorization: Basic auth.
You should send Consumer Key and Consumer Secret with your Request.
https://learning.postman.com/docs/sending-requests/authorization/#basic-authYou can navigate to yourwebsite.com/wp-json/mphb/v1/ to see all available routes and params.
For example:
1. GET request yourwebsite.com/wp-json/mphb/v1/bookings/ will return 10 recent bookings from your website.2. POST request yourwebsite.com/wp-json/mphb/v1/bookings/
with JSON data{ "reserved_accommodations": [ { "accommodation": 97, "adults": 1 } ], "check_in_date": "2021-11-27", "check_out_date": "2021-11-28" }
will create a new booking with params above.
3. PUT request yourwebsite.com/wp-json/mphb/v1/bookings/410
with JSON data{ "status":"cancelled" }
will set status of the booking #410 to Cancelled.
December 8, 2021 at 7:00 am #1228460Alex MParticipantDecember 8, 2021 at 7:25 am #1228470Loris PlassonParticipantThanks for the update!
- AuthorPosts
- You must be logged in to reply to this topic.