# Custom query with CakePHP3 REST API

**URL:** <https://discourse.cakephp.org/t/custom-query-with-cakephp3-rest-api/1396>\
**Category:** Need Help\
**Created:** [October 29, 2016, 2:56am UTC](https://discourse.cakephp.org/t/custom-query-with-cakephp3-rest-api/1396 "2016-10-29T02:56:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bstras21](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@bstras21](https://discourse.cakephp.org/u/bstras21)\
**Post date:** [October 29, 2016, 2:56am UTC](https://discourse.cakephp.org/t/custom-query-with-cakephp3-rest-api/1396/1 "2016-10-29T02:56:37Z")

</div>

I just finished this tutorial creating a REST API with cakePHP3:

[http://www.bravo-kernel.com/2015/04/how-to-build-a-cakephp-3-rest-api-in-minutes/](http://www.bravo-kernel.com/2015/04/how-to-build-a-cakephp-3-rest-api-in-minutes/)

Everything works perfectly and all results are delivered via json  
(using postman). My question is, where do I edit/create my query so I  
can limit the results based on id. I’m assuming I must do it  
Model/Table/Cocktails.php? If so, then do I create a custom route to  
that?
