[#1106] Bulk status update for multiple booking ids

Migrated from Redmine #1106 | Author: Jagan Pandurangan
Status: New | Priority: Normal | Created: 2023-09-12


We would like to know if there is a way to update multiple bookings in a single API call
We need to perform these 2 actions

Apply status with status custom feature using REST - API documentation | SimplyBook.me Online Scheduling

editBook of JSON RPC - API documentation | SimplyBook.me Online Scheduling

Since recurring bookings generate multiple booking ids and codes, we need to loop over all ids which are dozens in number.
Is there a way we can update these two for multiple booking ids and codes in single API call?

Redmine Admin wrote:

hi, there is no such API methods. You have to update bookings one by one

Jagan Pandurangan wrote:

We frequently get errors because the apis are being rate limited.
I would like to know,

How to overcome the rate limit? What is the minimum time required between the consecutive API calls?

What should be done to relax the rate limit?

Redmine Admin wrote:

API limits are based on fair usage concept. Please provide example of what you are doing when getting this?

Jagan Pandurangan wrote:

Ours is a baby sitting app.
After a parent book sessions for multiple days (each day being recurring), we are making multiple API calls
We have a requirement to book a maximum for 48 weeks on a day (48 recurring weeks)

So for example, parent chooses Monday to Friday (7 days) and chooses a time say 9:00 to 10:00 and sets the recurring data to book for 48 weeks, the total booking ids/code is 48*7 = 336.

We need to do editBook, update status color and confirmInvoice on all 336 of them

So it fails sometimes.

We are planning to add 250ms delay between each request and it seems to allow. So just asking if this traffic will not be suddenly blocked in the future after we go live.

Redmine Admin wrote:

Thank you, I see. Not a very common case for us. 250ms-500ms delay should solve it. It is a good idea to use some queue manager for such API calls

Jagan Pandurangan wrote:

And it would be great if this 250ms delay that we have now can be reduced since it is taking 5 minutes to complete all the items in the loop one by one.

So can you tell me the lowest number for the delay that is safe?

Jagan Pandurangan wrote:

Since we currently do not have a backend system, we are not able to implement queues. We are doing all of this in client side.

So it would be great if this 250ms delay that we have now can be reduced since it is taking 5 minutes to complete all the items in the loop one by one.

Please tell me the lowest number for the delay that is safe.

Redmine Admin wrote:

unfortunately it is not possible to change this because this related to multi factor DDoS protection mechanism. There are limitations for API calls per second, minute, etc. generally 5 requests per second is fine. However if we are talking about long queue of requests then 2 requests per second must be fine.
You can set default status which will suite most part of the new bookings.
Confirm invoice should be called only once for the whole recurring batch (if you use recurring booking feature and bookings were booked as one recurring booking)

Jagan Pandurangan wrote:

Confirm invoice should be called only once for the whole recurring batch (if you use the recurring booking feature and bookings were booked as one recurring booking) - Let me check this one. Thanks

Default status will not help here because the booking happens first and we need it in draft mode. We give some time for the user to pay next. After successful payment, we need to confirm the invoice.

Does rate limit consider a single API while limiting? If yes, can I make 3 different apis at the same time with 250ms delay between consecutive APIs of the same type?