Migrated from Redmine #1024 | Author: Adriana Capua Status: Feedback | Priority: High, I’m very impatient | Created: 2023-03-15
Currently, we are enhancing our booking modal on our website. And we are trying to achieve the following items but we are not sure about some functionalities of Simplybook. Could you please help us and see how we can achieve theses using Simplybook API?
We are trying to get all the bookings of a customer when the customer clicks on the booking confirmation email that has a link
To achieve this we want to use the existing ‘Email and SMS (text messages) settings’ templates and insert a ‘template vars’ (Our website link appended with customer-hash) in the email template. And on our website, we’ll use the hash to get all the customer bookings. But we couldn’t find an API endpoint that allows us to get the bookings using customer-hash. We don’t want to expose the actual email Id in the link hence wanted to use a customer’s hash. Is there a way to achieve this?
We have enabled the cancellation reason feature in Simplybook, how can we use that field to put cancellation reason data for a booking via an API end-point? On the documentation page, we only see the endpoint to cancel a booking but no way to update the reason for cancellation.
Unfortunately, Simplybook does not provide a direct API endpoint to retrieve bookings for a customer using a hash value. However, there are a few alternative options you can consider:
You can use the GET /booking endpoint in the Simplybook API to retrieve a list of bookings, filtered by the customer’s email address. You can retrieve the email address from the hash value that is appended to the URL in the email template.
If you do not want to expose the customer’s email address in the URL, you can consider using a unique identifier for each customer, such as a customer ID. You can create a custom field in Simplybook to store the customer ID, and use the GET /booking endpoint to retrieve bookings filtered by the customer ID instead of the email address.
Regarding the second question, Simplybook does not provide a direct API endpoint to update the cancellation reason for a booking. The only available API endpoint is PUT /booking/{booking_id}/cancel, which is used to cancel a booking and set the reason for cancellation at the same time. If you want to update the reason for cancellation for a booking that has already been cancelled, you will need to do so manually through the Simplybook admin interface.
In the Email and SMS (text messages) settings page, I can only see these client-related template vars. (pls see screenshots attached) Could you please guide me on where I can create a custom field to store the customer ID?