# Échec de la pagination initiale des sujets dans la catégorie

**URL:** https://meta.discourse.org/t/initial-paging-for-topics-in-category-is-failing/96436
**Category:** Bug
**Created:** [Septembre 5, 2018, 6:11 UTC](https://meta.discourse.org/t/initial-paging-for-topics-in-category-is-failing/96436 "2018-09-05T18:11:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jdevost](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jdevost/32/119493_2.png) [@jdevost](https://meta.discourse.org/u/jdevost)
#### Post date: [Septembre 5, 2018, 6:11 UTC](https://meta.discourse.org/t/initial-paging-for-topics-in-category-is-failing/96436/1 "2018-09-05T18:11:55Z")

</div>

I think an issue was introduced regarding paging when getting topics for a category.

`/c/{id}.json?page=0` doesn’t work anymore. We get a 400 errors with `invalid_parameters `.  
We need to remove the `page` parameter when value is 0. `page=1` is valid (but that is the 2nd page).  
`page=0` used to be valid.

`page=0` is working when getting posts from topics.  
I think it should be consistent and have support for `page=0` everywhere for all types. It makes the use of your API easier.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [Septembre 5, 2018, 6:23 UTC](https://meta.discourse.org/t/initial-paging-for-topics-in-category-is-failing/96436/2 "2018-09-05T18:23:36Z")

</div>

This was indeed changed recently. @gerhard should be able to provide some background on the change.  
[https://github.com/discourse/discourse/commit/f33433bf9e0c1b57c5862d8e5c7ae28579b5bd3b](https://github.com/discourse/discourse/commit/f33433bf9e0c1b57c5862d8e5c7ae28579b5bd3b)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Septembre 5, 2018, 7:01 UTC](https://meta.discourse.org/t/initial-paging-for-topics-in-category-is-failing/96436/4 "2018-09-05T19:01:07Z")

</div>

Right. Looks like I got confused by the fact that we always converted invalid page numbers to 1 and assumed that page numbers start at 1. Sorry about that.

[https://github.com/discourse/discourse/commit/26082688d1c01aad8174cccc36cddeda96aa6978](https://github.com/discourse/discourse/commit/26082688d1c01aad8174cccc36cddeda96aa6978)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [Septembre 5, 2018, 8:12 UTC](https://meta.discourse.org/t/initial-paging-for-topics-in-category-is-failing/96436/5 "2018-09-05T20:12:59Z")

</div>


