# Can't get data from timelion API using curl when in the dev mode

**URL:** <https://discuss.elastic.co/t/cant-get-data-from-timelion-api-using-curl-when-in-the-dev-mode/143384>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [August 7, 2018, 7:01pm UTC](https://discuss.elastic.co/t/cant-get-data-from-timelion-api-using-curl-when-in-the-dev-mode/143384 "2018-08-07T19:01:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![trex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trex/32/34230_2.png) [@trex](https://discuss.elastic.co/u/trex)\
**Post date:** [August 7, 2018, 7:01pm UTC](https://discuss.elastic.co/t/cant-get-data-from-timelion-api-using-curl-when-in-the-dev-mode/143384/1 "2018-08-07T19:01:31Z")

</div>

Kibana, tag v6.2.4, official repo [https://github.com/elastic/kibana](https://github.com/elastic/kibana).

Run Kibana

```auto
cd kibana
npm start

```

Run curl

```auto
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" -H "kbn-xsrf: anything" -H "Connection: keep-alive" localhost:5601/api/timelion/run -d '{"s
heet":[".es(*).label(all)"],"time":{"from":"now-15m","interval":"auto","mode":"quick","timezone":"Europe/Berlin","to":"now"}}'

```

Response

```auto
{"statusCode":404,"error":"Not Found","message":"Not Found"}

```

But it works if Kibana is not the dev mode.

Run Kibana

```auto
cd kibana
./bin/kibana

```

Run curl

```auto
 curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" -H "kbn-xsrf: anything" -H "Connection: keep-alive" localhost:5601/api/timelion/run -d '{"s
heet":[".es(*).label(all)"],"time":{"from":"now-15m","interval":"auto","mode":"quick","timezone":"Europe/Berlin","to":"now"}}'                                                                              

```

Response

```auto
{"sheet":[{"type":"seriesList","list":[{"data":[[1533667372000,0],[1533667373000,0],....

```

Why do I get 404 response in the dev mode? How to query the timelion API in the dev mode?

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [August 7, 2018, 8:24pm UTC](https://discuss.elastic.co/t/cant-get-data-from-timelion-api-using-curl-when-in-the-dev-mode/143384/2 "2018-08-07T20:24:13Z")

</div>

When you run kibana in dev-mode, it starts up under a nested path. Usually 3 random letters precede the location of the Kibana-app.

e.g.

`localhost:5601/foo/api/timelion/run`instead of `localhost:5601/api/timelion/run`

Could you check if the URL you post your message to exists?

---

<div class="post-metadata">

**Author:** ![trex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trex/32/34230_2.png) [@trex](https://discuss.elastic.co/u/trex)\
**Post date:** [August 8, 2018, 12:31pm UTC](https://discuss.elastic.co/t/cant-get-data-from-timelion-api-using-curl-when-in-the-dev-mode/143384/3 "2018-08-08T12:31:34Z")

</div>

@thomasneirynck you are right.

Kibana added 3 letter word `pzd` in the dev mode: [http://192.168.1.111:5601/pzd/app/kibana](http://192.168.1.111:5601/pzd/app/kibana)

I added this word to curl url and got correct response.

```auto
curl -XPOST -H "Content-Type: application/json" -H "Accept: application/json, text/plain, */*" -H "kbn-xsrf: anything" -H "Connection: keep-alive" localhost:5601/pzd/api/timelion/run -d '{"s
heet":[".es(*).label(all)"],"time":{"from":"now-15m","interval":"auto","mode":"quick","timezone":"Europe/Berlin","to":"now"}}'                                                                              

```

Thank you.

---

<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:** [September 5, 2018, 12:31pm UTC](https://discuss.elastic.co/t/cant-get-data-from-timelion-api-using-curl-when-in-the-dev-mode/143384/4 "2018-09-05T12:31:36Z")

</div>

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