# Signed Search Key via API

**URL:** <https://discuss.elastic.co/t/signed-search-key-via-api/215457>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [January 17, 2020, 12:40pm UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457 "2020-01-17T12:40:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![malik\_aditya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/malik_aditya/32/45618_2.png) [@malik\_aditya](https://discuss.elastic.co/u/malik_aditya)\
**Post date:** [January 17, 2020, 12:40pm UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457/1 "2020-01-17T12:40:23Z")

</div>

Hi, I was trying to use SignedSearchKey approach via API but the search and result settings are applied to the whole engine instead for that specifc key. Is there any workaround for that? Like creating keys with predefined search and result settings. So you can just use different keys to search on different specific fields and get differnt result sets.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [January 17, 2020, 12:52pm UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457/2 "2020-01-17T12:52:50Z")

</div>

@malik_aditya What you are describing is exactly how Signed Search Keys work. The keys are encoded with "predefined search and result settings".

---

<div class="post-metadata">

**Author:** ![malik\_aditya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/malik_aditya/32/45618_2.png) [@malik\_aditya](https://discuss.elastic.co/u/malik_aditya)\
**Post date:** [January 20, 2020, 5:08am UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457/3 "2020-01-20T05:08:36Z")

</div>

Yeah but for that there's a requirement of client. I wanted to avoid client and work directly via API.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [January 21, 2020, 12:19pm UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457/4 "2020-01-21T12:19:54Z")

</div>

@malik_aditya I understand. You can use the client for generating the key and continue passing it into your own API calls as you are currently. Alternatively, if you _still_ want to avoid the client, you could write the code to generate the signed search key yourself. Look at the code the clients run as an example: [https://github.com/elastic/app-search-node/blob/ef6823f47840cb505487021542852324ae3e74e0/lib/appSearch.js#L265](https://github.com/elastic/app-search-node/blob/ef6823f47840cb505487021542852324ae3e74e0/lib/appSearch.js#L265).

I recommend simply using the clients to create a signed search key, they are there as a convenience.

---

<div class="post-metadata">

**Author:** ![malik\_aditya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/malik_aditya/32/45618_2.png) [@malik\_aditya](https://discuss.elastic.co/u/malik_aditya)\
**Post date:** [January 23, 2020, 5:25am UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457/5 "2020-01-23T05:25:43Z")

</div>

Hi Jason, Thanks for your suggestion. I was able to get the Signed Search Key and use it in API calls.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 20, 2020, 5:25am UTC](https://discuss.elastic.co/t/signed-search-key-via-api/215457/6 "2020-02-20T05:25:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
