#Hamze-request-time

1 messages · Page 1 of 1 (latest)

scarlet thorn
#

Can you tell me a bit more about your use case here?

molten pagoda
#

I just asked this to toby but I realized that it could take a long time for requests with more than 1000 customers #dev-help message

scarlet thorn
#

What is the context in which you are loading all 1000?

#

I am trying to understand the context and what might be an acceptable solution

molten pagoda
#

we are a SAS and we need to check all our users for no replication, get ids, moreever

#

my request is in 1900ms

#

with the repagination will call it more than 10 times

scarlet thorn
#

Right, in this case it sounds like the focus would be more on reducing the number of times you need to fully re-request the list of users from us.

molten pagoda
#

yes

scarlet thorn
#

Is that 1900ms for one 100 customer call now or all of your customers now?

molten pagoda
#

just for a first hundred customers

frail forge
#

This should only be a one-time activity, or at least rare, right? it sounds like it should be OK for it to take a while.

#

are you including any expansion in those requests?

molten pagoda
#

we have more than 1000 customers and this will take a long time

molten pagoda
frail forge
molten pagoda
scarlet thorn
#

Can you check the headers for that response?

#

There should be a request ID in the form of req_123 that will help us look further in to this request

molten pagoda
scarlet thorn
#

Apologies, I said "request" not "response" originally

#

Can you check the "response"?

surreal cape
#

This is the req_123 "req_DxEn7HR489pFq9"

#

we take it on the response header

scarlet thorn
#

Thank you.

molten pagoda
#

we need to do a repagination with this request that will be called more than 10 times, because the call limit is 100 users

frail forge
#

how often do you need to perform this task? it's just a lot of information you're requesting.

#

what exactly are you looking for when you do it?

molten pagoda
#

every time a new registration is made and when the user enters the application

frail forge
#

what do you mean?

#

what is "registration" in this context?

molten pagoda
#

I need to check if there is a duplicate user and get the specific customer id

frail forge
#

duplicate according to what?

#

how do you determine duplicates?

molten pagoda
#

I check the email of the user logged into the application, I check if this user is in the stripe and get his id

frail forge
#

you can filter that customer list API by matching emails

#

email=user@site.com

#

and you'll only have customer objects with that matching email

molten pagoda
#

is exactly what i'm doing

#

but i need to get the id in some cases

frail forge
#

what do you mean>?

molten pagoda
#

I will control billings by stripe

surreal cape
#

We manage our billing and subscriptions at stripe

frail forge
#

if you're matching on email, you dont need all customers, you only need customers with the same email address, right?

molten pagoda
#

For this we will register customers that will be in the stripe but the endpoint to return users only returns a maximum of 100 at a time I will do a repagination on this endpoint, to call 100 out of 100 until I sweep all the customers but this takes a long time

frail forge
#

yes but why do you need all customers?

#

except for a rare one-time job

molten pagoda
#

To check which ones are in range, don't let duplicate emails and get the customer id logged into my app during a request

frail forge
#

you wont be able to retrieve and inspect 10k customers "quickly" during a synchronous new users registration, that's just not possible. so i'm trying to help you distill what you actually need during that process to make your api calls more efficient.

#

are you just trying to find existing customer object with that same email address?

molten pagoda
#

not only that i also need to get information from a specific user with just the email

#

I need this information to verify a customer's subscription, whether it's active or not.

scarlet thorn
#

Right, the list function will give you a list of Customer objects so they will have the relevant info

#

Including when you filter by email

molten pagoda
scarlet thorn
#

If you filter by email this will be a single request

molten pagoda
#

because I will have to call the same endpoint multiple times

scarlet thorn
#

It would filter all 1000 users

molten pagoda
#

A limit on the number of objects to be returned, between 1 and 100

scarlet thorn
#

You would only need to page that call if there are more than 100 customer objects with the same email

#

Correct, that is the maximum number of objects to be returned. It will still filter through all of your customer objects.

molten pagoda
#

alright thank you very much

frail forge
#

@molten pagoda try it out, please

#

to you list request, add a parameter email=test@example.com

#

try it for a user you know exists

#

and a fake one that doesnt

#

it filters all objects in your account and returns a paginated result after the filter is applied

molten pagoda
#

Perfect, thanks very much