# Loading a REST call response JSON with Vega-Lite, is it possible?

**URL:** <https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722>\
**Category:** Kibana\
**Created:** [April 19, 2018, 2:07pm UTC](https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722 "2018-04-19T14:07:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KibanaUse](https://avatars.discourse-cdn.com/v4/letter/k/e9c0ed/32.png) [@KibanaUse](https://discuss.elastic.co/u/KibanaUse)\
**Post date:** [April 19, 2018, 2:07pm UTC](https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722/1 "2018-04-19T14:07:55Z")

</div>

Hello,

I started using Vega plugin and trying to load data from a url, which is actually a REST call that returns a json file.

Is it doable?

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [April 20, 2018, 12:50pm UTC](https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722/2 "2018-04-20T12:50:05Z")

</div>

yes, just unless you need to send some special headers to your endpoint ?

---

<div class="post-metadata">

**Author:** ![KibanaUse](https://avatars.discourse-cdn.com/v4/letter/k/e9c0ed/32.png) [@KibanaUse](https://discuss.elastic.co/u/KibanaUse)\
**Post date:** [April 20, 2018, 12:55pm UTC](https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722/3 "2018-04-20T12:55:04Z")

</div>

Thanks, no I don't.

Should I just write the get request as

"data": {  
"url" : "[http://172](http://172).........:8086/.............?servletContext=...........&format=json"  
}

like this?

I did but nothing happens.

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 20, 2018, 3:27pm UTC](https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722/4 "2018-04-20T15:27:36Z")

</div>

You need to specify `format` so vega knows where/how to pull rows out of the response.  
Checkout the vega documentation for more details [https://vega.github.io/vega-lite/docs/data.html#url](https://vega.github.io/vega-lite/docs/data.html#url)

```auto
"data": {
  "url": "myurlthatreturnsjson",
  "format": {
    "type": "json",
    "property": "path.to.rows"
  }
}

```

---

<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 18, 2018, 3:27pm UTC](https://discuss.elastic.co/t/loading-a-rest-call-response-json-with-vega-lite-is-it-possible/128722/5 "2018-05-18T15:27:50Z")

</div>

Closed on May 18, 2018, 3:27pm UTC

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