# REST API using http\_poller

**URL:** https://discuss.elastic.co/t/rest-api-using-http-poller/205107
**Category:** Logstash
**Created:** [October 24, 2019, 3:09pm UTC](https://discuss.elastic.co/t/rest-api-using-http-poller/205107 "2019-10-24T15:09:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![akhilsharma.in](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@akhilsharma.in](https://discuss.elastic.co/u/akhilsharma.in)
#### Post date: [October 24, 2019, 3:09pm UTC](https://discuss.elastic.co/t/rest-api-using-http-poller/205107/1 "2019-10-24T15:09:32Z")

</div>

We have to implement REST API using http\_poller if it is possible.  
It has two calls.

1st POST creates a token which has to be used by 2nd REST GET. Can I pass the output token of 1st call to the input of other http\_poller so that it uses that token?

Please help.

Thanks  
Akhil

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 24, 2019, 3:50pm UTC](https://discuss.elastic.co/t/rest-api-using-http-poller/205107/2 "2019-10-24T15:50:03Z")

</div>

> [@akhilsharma.in](#):
>
> Can I pass the output token of 1st call to the input of other http\_poller so that it uses that token?

No, there is no way for inputs to communicate. However, you could do the second call using an http filter rather than an http\_poller input.

---

<div class="post-metadata">

### Author: ![akhilsharma.in](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@akhilsharma.in](https://discuss.elastic.co/u/akhilsharma.in)
#### Post date: [October 24, 2019, 4:16pm UTC](https://discuss.elastic.co/t/rest-api-using-http-poller/205107/3 "2019-10-24T16:16:55Z")

</div>

Thanks for confirming Badger. I tried doing the second call with http filter, but I could not figure out that how to capture output from second call (http). There is no option of target or something?

Can you please instruct?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 24, 2019, 5:01pm UTC](https://discuss.elastic.co/t/rest-api-using-http-poller/205107/4 "2019-10-24T17:01:19Z")

</div>

See the [target\_body](https://www.elastic.co/guide/en/logstash/current/plugins-filters-http.html#plugins-filters-http-target_body) option.

---

<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: [November 21, 2019, 5:01pm UTC](https://discuss.elastic.co/t/rest-api-using-http-poller/205107/5 "2019-11-21T17:01:26Z")

</div>

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