# Connecting app-search to postman via the REST API

**URL:** <https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [April 28, 2022, 10:47pm UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557 "2022-04-28T22:47:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ines\_ZAYANI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ines_zayani/32/104584_2.png) [@Ines\_ZAYANI](https://discuss.elastic.co/u/Ines_ZAYANI)\
**Post date:** [April 28, 2022, 10:47pm UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557/1 "2022-04-28T22:47:55Z")

</div>

hello everyone!  
I'm trying to connect app-search to postman: while using the Dev Tools in kibana i tried with POST and got the following error:

Request:  
GET '[http://localhost:3002/api/as/v1/engines/iot/search.json](http://localhost:3002/api/as/v1/engines/iot/search.json)' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer [API\_KEY]' \   
-d '{  
"page": {  
"current": 2,  
"size": 15  
}  
}'

Response:  
{  
"error" : "no handler found for uri [/'http%3A//localhost%3A5601/api/as/v1/engines/iot/search.json'?pretty=true] and method [GET]"  
}

and if i access this "[http://localhost:3002/api/as/v1/engines/iot/search.json](http://localhost:3002/api/as/v1/engines/iot/search.json)" on my browser i get the following error:  
"Missing required parameter: query"

Please if you have any recommendations??

---

<div class="post-metadata">

**Author:** ![Irina\_Truong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irina_truong/32/112040_2.png) [@Irina\_Truong](https://discuss.elastic.co/u/Irina_Truong)\
**Post date:** [April 28, 2022, 11:19pm UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557/2 "2022-04-28T23:19:12Z")

</div>

Hi @Ines_ZAYANI ,

You can't use Kibana Dev Tools to query the App Search API. But you can use either curl, or Postman. Postman does have a great UI that makes things easier.

With curl, you would issue the command in your terminal console as follows:

```auto
curl -XGET "http://localhost:3002/api/as/v1/iot/search" \
-H 'Authorization: Bearer [API_KEY]' \
-H 'Content-Type: application/json' \
-d '{"query": "blah", "page": {"current": 1, "size": 10}}'

```

You must specify the `query`. This is not optional. This is why you get the error message when you open that URL in the browser.

See the documentation page here:

> **[Search API | Elastic App Search Documentation \[8.1\] | Elastic](https://www.elastic.co/guide/en/app-search/current/search.html)**

You can' however, specify an empty string, if you want all documents back.

With Postman, you would fill in authorization, provide the URL and query body:

![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ad832eacfb537ac8ad13b0a496689fc7996c2e60.png)

By the way, there's no need to attach `json` suffix to `search` endpoint.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![Nasri\_amani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nasri_amani/32/105011_2.png) [@Nasri\_amani](https://discuss.elastic.co/u/Nasri_amani)\
**Post date:** [April 29, 2022, 12:08am UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557/5 "2022-04-29T00:08:42Z")

</div>

Which one of the api keys put on postman for doing the Authorization

---

<div class="post-metadata">

**Author:** ![Ines\_ZAYANI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ines_zayani/32/104584_2.png) [@Ines\_ZAYANI](https://discuss.elastic.co/u/Ines_ZAYANI)\
**Post date:** [April 29, 2022, 10:54am UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557/6 "2022-04-29T10:54:36Z")

</div>

Thanks @Irina_Truong that was actually very helpfull i tried with postman and everything worked out very well.

---

<div class="post-metadata">

**Author:** ![Irina\_Truong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irina_truong/32/112040_2.png) [@Irina\_Truong](https://discuss.elastic.co/u/Irina_Truong)\
**Post date:** [April 29, 2022, 10:20pm UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557/7 "2022-04-29T22:20:53Z")

</div>

You can use search key, private key, basic auth (username / password), any of those methods will work with the `search` endpoint.

---

<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:** [May 27, 2022, 10:21pm UTC](https://discuss.elastic.co/t/connecting-app-search-to-postman-via-the-rest-api/303557/8 "2022-05-27T22:21:17Z")

</div>

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