# Json api not filtering by template id

**URL:** <https://forum.canton.network/t/json-api-not-filtering-by-template-id/1754>\
**Category:** App Development\
**Tags:** json-api\
**Created:** [December 8, 2020, 1:40pm UTC](https://forum.canton.network/t/json-api-not-filtering-by-template-id/1754 "2020-12-08T13:40:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lashenhurst](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lashenhurst](https://forum.canton.network/u/lashenhurst)\
**Post date:** [December 8, 2020, 1:40pm UTC](https://forum.canton.network/t/json-api-not-filtering-by-template-id/1754/1 "2020-12-08T13:40:11Z")

</div>

Hi there!

I’m playing around with the json api service and I’m running in to a strange issue in my sandbox environment. I try to get contracts by query, giving an empty list for templateIds, and an empty map for query. This gives me all active contracts. Then, I copy one templateId from an active contract, and add that to my previously empty templateIds list in the request. When I submit the request a second time with that change, I still receive all active contracts in the response, regardless of templateId.

Is this intentional? Or have I done something wrong?

Also, when I use a feign client (in my spring boot middleware) to try to send the same request, with what I believe is the same body, I get “Cannot resolve any template ID from request”, so I’m not exactly sure what’s correct here!

Thank you.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [December 8, 2020, 2:02pm UTC](https://forum.canton.network/t/json-api-not-filtering-by-template-id/1754/2 "2020-12-08T14:02:31Z")

</div>

Are you sure you changed the `GET` to a `POST`? Request bodies on `GET` requests are ignored (that’s a general HTTP thing, not specific to the JSON API). If you want to filter by template id, you need to send a `POST`.

---

<div class="post-metadata">

**Author:** ![lashenhurst](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lashenhurst](https://forum.canton.network/u/lashenhurst)\
**Post date:** [December 8, 2020, 2:18pm UTC](https://forum.canton.network/t/json-api-not-filtering-by-template-id/1754/3 "2020-12-08T14:18:51Z")

</div>

… That’s a little embarrassing. Thank you.

For future reference, the second issue I mentioned, regarding the feign client attempting the same request: The solution was that the template Id generated by the DAML Maven plugin is not the correct format for the json api service request.
