# Ruby Client for X-Pack SQL

**URL:** <https://discuss.elastic.co/t/ruby-client-for-x-pack-sql/143497>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [August 8, 2018, 11:18am UTC](https://discuss.elastic.co/t/ruby-client-for-x-pack-sql/143497 "2018-08-08T11:18:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul1243](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@paul1243](https://discuss.elastic.co/u/paul1243)\
**Post date:** [August 8, 2018, 11:18am UTC](https://discuss.elastic.co/t/ruby-client-for-x-pack-sql/143497/1 "2018-08-08T11:18:54Z")

</div>

Hi -  
Am trying to execute the SQL queries using the X-Pack API's with the ruby client (elasticsearch ~\> 6.1) gem.  
Could someone please help me how do I send the POST request using the ruby client. Thanks !

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [August 13, 2018, 3:42pm UTC](https://discuss.elastic.co/t/ruby-client-for-x-pack-sql/143497/2 "2018-08-13T15:42:25Z")

</div>

Hi Paul, I work mostly on Kibana so I'm a little rusty when it comes to ES. But I took a look at the [elasticsearch-xpack docs for the Ruby client](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-xpack) and it states:

> For documentation, look into the RDoc annotations in the source files, which contain links to the official [X-Pack for the Elastic Stack](https://www.elastic.co/guide/en/x-pack/current/index.html) documentation.

So I looked in the source, and found the definition for the [query action](https://github.com/elastic/elasticsearch-ruby/blob/master/elasticsearch-xpack/lib/elasticsearch/xpack/api/actions/sql/query.rb). Can you take a look and let me know if this helps you? This same directory also contains the source for the close cursor and translate actions.

Thanks,  
CJ

---

<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 10, 2018, 3:42pm UTC](https://discuss.elastic.co/t/ruby-client-for-x-pack-sql/143497/3 "2018-09-10T15:42:27Z")

</div>

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