I am reaching the api limits

Hey guys,

we are a punt renting business where each punt trip has a to have a driver. For that, I have created a hidden "cusom_driver" property in the booking mask which gets filled out by our staff after the booking.

I created a frontend for the drivers where they have an overview of their trips for the day with all the informations they need. For that I have to fetch all bookings for that day and then go through every 'booking_code' to have access to 'booking.fields.custom_driver' because the `booking/index` endpoint only gives me:

```
"booking_id": {
  "booking_id",
  "code",
  "status_id",
  "status_name",
  "created_date",
  "total",
  "tax_total",
  "paid_total",
  "customer_id",
  "customer_name",
  "customer_email",
  "summary",
  "date_desc",
  "tid",
  "token",
}
``` 

These are the steps I am performing:

```
/booking/index?start_date=21.07.2017&end_date=21.07.2017
/booking/xxxx-xxxxxx 
```

It works fine for the daily lists, peaks are about 50 Trips a day.

Now, I want to create an accounting overview where the drivers can specify a date range so they can, for example, have an overview of all their trips in during the season.
I am reaching the api limits, for example if i want to fetch the range from 21.07.2017 to 23.07.2017 i have to go through 76 results which means that I am sending 76 simultaneous requests to your api.

My question is: Do you have any suggestions on how I can either optimize my code, change something in the booking form or do something to not exceed the api limit?

Thanks in advance,

Dimi

Comments

  • Hi Dimi,

    Thanks for your message! I'd recommend that you take advantage of the webhooks we offer so that instead of having to query for the booking, we send you payload that includes it when it's created or modified. You should also leverage caching on your end to cut down on API requests.

    To learn more about the webhooks we offer please see: http://api.checkfront.com/ref/notifications.html

    Cheers,
    Mitch
    Checkfront Developer
  • Hey Mitch,

    thanks for the reply.
    I will mirror the complete 'Database' to our backend with the webhooks so I don't have to use your API anymore.


Sign In or Register to comment.