Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Endpoints Pagination and Rate Limits #249

Open
jawad-r3 opened this issue Jan 15, 2021 · 3 comments
Open

Get Endpoints Pagination and Rate Limits #249

jawad-r3 opened this issue Jan 15, 2021 · 3 comments
Labels
Status: In Discussion Tag individuals in the comments you wish to discuss issue with Type: Feature Request

Comments

@jawad-r3
Copy link

As per documentation, it is mentioned that All API Endpoints will return max 100 results and pagination should be implemented by the Application. There seems to be no option in SDK to provide pagination offsets.

Also there seems to be no header for API Limits being returned but documentation mentions that each API call will return Limit headers (Remaining, Max, Retry After etc).

@SidneyAllen SidneyAllen self-assigned this Jan 19, 2021
@SidneyAllen
Copy link
Contributor

@jawad-r3

You are correct, there are no offsets when using pagination. You'll receive the first 100, then next 100, etc.

The SDK doesn't return header information from API calls. You're the first to ask for this feature. That would be good to add in the future. Do you have any thoughts of how you'd like this to work with the existing objects we return.

For example, calling getInvoices, returns and Invoices object. One approach would be to add a "headers" property to the invoices object and populate it with key/value pairs for remaining, max, retry after. Are there other header properties you're looking to access?

@SidneyAllen SidneyAllen added Status: In Discussion Tag individuals in the comments you wish to discuss issue with Type: Feature Request labels Jan 19, 2021
@lancedfr
Copy link
Contributor

+1 to this feature request.

We implemented this ourselves by configuring the AccountingApi class with an Apache Http client, the Apache http client is configured with an http response interceptor, the http response interceptor in turn extracts the header information just before the AccountingApi handles the response. It would be great if the SDK implemented this in the API model classes.

@alexswilliams
Copy link

Yes, we do something similar (subclassed the AccountingApi class and wraps the ...ForHttpResponse methods) - first class support would be lovely! It looks like many method return types are classes with single fields, I suspect a field that exposes the headers, or the full response object, or perhaps just the rate headers, would be appropriate to add to those objects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Discussion Tag individuals in the comments you wish to discuss issue with Type: Feature Request
Projects
None yet
Development

No branches or pull requests

4 participants