# Endpoint for callWithRequest of scroll query

**URL:** <https://discuss.elastic.co/t/endpoint-for-callwithrequest-of-scroll-query/107744>\
**Category:** Kibana\
**Created:** [November 15, 2017, 12:24pm UTC](https://discuss.elastic.co/t/endpoint-for-callwithrequest-of-scroll-query/107744 "2017-11-15T12:24:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [November 15, 2017, 12:24pm UTC](https://discuss.elastic.co/t/endpoint-for-callwithrequest-of-scroll-query/107744/1 "2017-11-15T12:24:31Z")

</div>

hello guys,

please give information about endpoint to make search query with scroll with callWithReqeust.

```
  if (request.payload.scroll_id !== null) {
                callWithRequest(request, ' **what should be here??? thanks**', {
                    index: `${config.es.default_index}`,
                    allowNoIndices: false,
                    body: {
                        size: 50,
                        scroll: '5m',
                        scroll_id: request.payload.scroll_id
                    }
                }).then((res) => reply(res))
                    .catch((err) => reply(handleESError(err)));
```

---

<div class="post-metadata">

**Author:** ![Court](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/court/32/6640_2.png) [@Court](https://discuss.elastic.co/u/Court)\
**Post date:** [November 15, 2017, 8:58pm UTC](https://discuss.elastic.co/t/endpoint-for-callwithrequest-of-scroll-query/107744/2 "2017-11-15T20:58:16Z")

</div>

In your initial search request, you'd just want `search`, and then in your subsequent scroll requests, you'd want `scroll`. Here's an example of this inside the Kibana source code: [https://github.com/elastic/kibana/blob/master/src/core\_plugins/kibana/server/routes/api/scroll\_search/index.js#L17](https://github.com/elastic/kibana/blob/master/src/core_plugins/kibana/server/routes/api/scroll_search/index.js#L17)

Feel free to use that as a guide, but I don't recommend using those two Kibana endpoints directly, since they will be removed in the near future without warning.

---

<div class="post-metadata">

**Author:** ![nugusbayevkk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nugusbayevkk/32/126683_2.png) [@nugusbayevkk](https://discuss.elastic.co/u/nugusbayevkk)\
**Post date:** [November 16, 2017, 5:30am UTC](https://discuss.elastic.co/t/endpoint-for-callwithrequest-of-scroll-query/107744/3 "2017-11-16T05:30:57Z")

</div>

hi, thanks, it help me ☀

---

<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:** [December 14, 2017, 5:30am UTC](https://discuss.elastic.co/t/endpoint-for-callwithrequest-of-scroll-query/107744/4 "2017-12-14T05:30:58Z")

</div>

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