# AQL query with query_parameters and GET method **Category:** [Platform](https://discourse.openehr.org/c/platform-implem/7) **Created:** 2024-02-14 17:15 UTC **Views:** 372 **Replies:** 7 **URL:** https://discourse.openehr.org/t/aql-query-with-query-parameters-and-get-method/4940 --- ## Post #1 by @surfer Hello, Let's consider a query like this one: *select c/uid/value, e/ehr_id/value from EHR e contains COMPOSITION c where c/archetype_details/template_id/value = $tid* with query_parameters={"tid":"template1"} In EHRBase, it works with the POST method but I can't get it to work with GET method. Anybody knows how to do it? is it even possible? --- ## Post #2 by @birger.haarbrandt Hi @surfer, we will take a look at that --- ## Post #3 by @surfer thank you @birger.haarbrandt :+1: --- ## Post #4 by @surfer @birger.haarbrandt any update on that? Still unable to run it with get method --- ## Post #5 by @vidi42 @surfer can you post the GET endpoint that you're trying to use? I managed to get a response with ``` GET {{ehrbaseBaseUrl}}/rest/openehr/v1/query/aql?q=select%20c%2Fuid%2Fvalue,%20e%2Fehr_id%2Fvalue%20from%20EHR%20e%20contains%20COMPOSITION%20c%20where%20c%2Farchetype_details%2Ftemplate_id%2Fvalue%20%3D%20%24tid&query_parameters=tid%3Dtemplate1 ``` --- ## Post #6 by @surfer Hi @vidi42 , the endpoint is the same: {ehrbase_url}/rest/openehr/v1/query/aql I mimic your query and **it works**, the difference being I previously created a json with query_parameters and then passed it as "query_parameters={tid:tidvalue}" instead of using "query_parameters=tid=tidvalue". but what about *multiple query parameters*? "query_parameters=tid=tidvalue,tid2=tid2value" does not work for me. How do I express multiple parameters in the GET query request? --- ## Post #7 by @vidi42 The query_parameters should look something like this `query_parameters=tid=tidvalue&tid2=tid2value` (see https://specifications.openehr.org/releases/ITS-REST/Release-1.0.3/query.html#tag/Query/operation/query_execute_adhoc_query) Make sure the URL is properly encoded, but it should look like this ``` GET {{ehrbaseBaseUrl}}/rest/openehr/v1/query/aql?q=select%20c%2Fuid%2Fvalue,%20e%2Fehr_id%2Fvalue%20from%20EHR%20e%20contains%20COMPOSITION%20c%20where%20c%2Farchetype_details%2Ftemplate_id%2Fvalue%20%3D%20%24tid2&query_parameters=tid%tidvalue%26tid2%3Dtid2value ``` --- ## Post #8 by @surfer that was it, thank you! --- **Canonical:** https://discourse.openehr.org/t/aql-query-with-query-parameters-and-get-method/4940 **Original content:** https://discourse.openehr.org/t/aql-query-with-query-parameters-and-get-method/4940