# Query Params on get route

**URL:** <https://discourse.slimframework.com/t/query-params-on-get-route/1835>\
**Category:** Questions\
**Created:** [September 27, 2017, 2:34pm UTC](https://discourse.slimframework.com/t/query-params-on-get-route/1835 "2017-09-27T14:34:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlazzeri](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@mlazzeri](https://discourse.slimframework.com/u/mlazzeri)\
**Post date:** [September 27, 2017, 2:34pm UTC](https://discourse.slimframework.com/t/query-params-on-get-route/1835/1 "2017-09-27T14:34:31Z")

</div>

I want to have this url [www.mydomain.com/api/operations?pageNumber=1](http://www.mydomain.com/api/operations?pageNumber=1) but I do not know how to implement that in the routes files, I try doing this

$app-\>get(’/operations?pageNumber={id}’, ‘OperationController:GetByPaginated’)-\>add(‘LoginMiddleware’);  
but the server respond with a 404 error.

could anyone help me with this?  
thanks

---

<div class="post-metadata">

**Author:** ![tstadler](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tstadler](https://discourse.slimframework.com/u/tstadler)\
**Post date:** [September 27, 2017, 5:50pm UTC](https://discourse.slimframework.com/t/query-params-on-get-route/1835/2 "2017-09-27T17:50:44Z")

</div>

Hi,

Slim uses only the path of the URI, not the query params.

please try $app-\>get(’/operations’, ‘OperationController:GetByPaginated’)-\>add(‘LoginMiddleware’);

you can access the query params via the getQueryParams() method of the ServerRequestInterface parameter of your callback.
