[#926] How to avoid API limits

Migrated from Redmine #926 | Author: David Beale
Status: New | Priority: Low, I can wait | Created: 2022-09-07


Hello,

I am in the process of write some code to access the APIs and want to ensure I avoid the API limits.

I will be calling :
https://user-api-v2.simplybook.me/admin/promotions/gift-cards?filter[purch_client_id]=42

To get all gift-cards that a customer has - because I can’t filter on used up gift-cards I will need to paginate and filter via code.
If I have multiple pages ( > 5) - then I will exceed the limits immediately - can you suggest any around this.

The ideal solution will be for me to use a filter of [can_be_used]=false , but this is ignored if I add it

Thanks

David

Redmine Admin wrote:

hi, i’m curious why customers have so many gift cards? - this is not something we expected to be the case.
You need to make this calls one by one, not in parallel and not more than a few per second - then it will be 100% fine

David Beale wrote:

Thanks for you response.

Gift Cards are our way for members to buy ‘blocks’ of tickets (e.g 10) for a reduced price. So a member will but a block of 10 - and user them within 2 weeks (booking water sports).

The standard user interface does not allow our members to see how many appointments they have remaining, so I am developing this code for that purpose.

So for some customers, they will have 50-70 gift cards - with most of them used up.

Are you recommending that for when I need to retrieve the pages via pagination - I should pause for 1 second between each call? (this will be a very slow response)

David

Redmine Admin wrote:

maybe you should look at our membership feature? - it seems it can be the way to solve this

David Beale wrote:

If a member purchases packages instead of Gift Certificates - can I retrieve the current package status via API?

Redmine Admin wrote:

unfortunately this is not possible

David Beale wrote:

So back to my original plan - If I do 5 consecutive API calls within a pagination loop, will this cause my API limits to be exceeded?

David Beale wrote:

Also - how can I request a product improvement, i.e the addition of can_be_used to the filter object for this api?