Skip to content

Commit 8d56123

Browse files
committed
Added notable APIs for pagination
1 parent 5f4603a commit 8d56123

File tree

1 file changed

+31
-0
lines changed
  • sessions/Season-05/0505-ApiDesignAndDevelopment

1 file changed

+31
-0
lines changed

sessions/Season-05/0505-ApiDesignAndDevelopment/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ Returns data and an indicator like `next_cursor` so you can make your next reque
5555
/products?cursor=hijkl&limit=10
5656
```
5757

58+
**Notable API:** Twitch does this with their [`GetStreams` API](https://dev.twitch.tv/docs/api/reference#get-streams)
59+
60+
```
61+
GET https://api.twitch.tv/helix/streams?after=abcdefgh12345
62+
```
63+
64+
Returns:
65+
66+
```json
67+
"data": [
68+
...
69+
],
70+
"pagination": {
71+
"cursor": "ghijk1234"
72+
}
73+
}
74+
```
75+
76+
5877
### Offset/Count paging
5978

6079
```
@@ -63,6 +82,12 @@ Returns data and an indicator like `next_cursor` so you can make your next reque
6382

6483
Returns 10 records starting with record #11
6584

85+
**Notable API:*** Facebook allows you to query the feed with a link like:
86+
87+
```
88+
https://facebook.com/me/feed?limit=25&offset=50
89+
```
90+
6691
### Keyset-based paging
6792

6893
```
@@ -71,6 +96,12 @@ Returns 10 records starting with record #11
7196

7297
Returns 10 records created AFTER `OrderId` with key 10123
7398

99+
**Notable API:** Twitch provides this pagination with their clips but instead of taking a key, receives a timestamp
100+
101+
```
102+
GET https://api.twitch.tv/helix/clips?started_at=2021-08-01T09:10:00-00:00&first=100
103+
```
104+
74105
## Uploading files to an API
75106

76107
Instead of receiving an input parameter of type string or int, receive an input parameter of type `IFormFile` like this:

0 commit comments

Comments
 (0)