This is exactly what I wanted to do.
Maybe I should clarify this, this is my basic scenario:
- I call get clips endpoint to get first page of result for specific game_id
- I use pagination cursor with after argument to get second page of results
- I use pagination cursor with before argument to get again first page of results
Request made:
RQ1:
RS1:
{
data: [....],
pagination: {
cursor: eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1qQT0ifX0
}
}
RQ2:
https://api.twitch.tv/helix/clips?game_id=509658&after=eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1qQT0ifX0
RS2:
{
data: [....],
pagination: {
cursor: eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1qQT0ifX0
}
}
RQ3:
https://api.twitch.tv/helix/clips?game_id=509658&before=eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6Ik1qQT0ifX0
RS3:
{
"error": "Bad Request",
"status": 400,
"message": "invalid cursor"
}