You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -193,6 +193,8 @@ The library automatically handles paging for you. Collections, such as `calls` a
193
193
194
194
`list` eagerly fetches all records and returns them as a list, whereas`stream` returns an iterator and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the`page` method.
195
195
196
+
`page_size` as a parameter is used to tell how many records should we get in every page and`limit` parameter is used to limit the max number of records we want to fetch.
197
+
196
198
####Use the`list` method
197
199
198
200
```python
@@ -206,6 +208,21 @@ for sms in client.messages.list():
206
208
print(sms.to)
207
209
```
208
210
211
+
```python
212
+
client.messages.list(limit=20,page_size=20)
213
+
```
214
+
This will make 1 call that will fetch 20 records from backend service.
215
+
216
+
```python
217
+
client.messages.list(limit=20,page_size=10)
218
+
```
219
+
This will make 2 calls that will fetch 10 records each from backend service.
220
+
221
+
```python
222
+
client.messages.list(limit=20,page_size=100)
223
+
```
224
+
This will make 1 call which will fetch 100 records but user will get only 20 records.
225
+
209
226
###Asynchronous API Requests
210
227
211
228
By default, the Twilio Client will make synchronous requests to the Twilio API. To allow for asynchronous, non-blocking requests, we've included an optional asynchronous HTTP client. When used with the Client and the accompanying`*_async` methods, requests made to the Twilio API will be performed asynchronously.