# Using REST API in Curl Command

**URL:** <https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412>\
**Category:** Kibana\
**Created:** [March 20, 2020, 11:56am UTC](https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412 "2020-03-20T11:56:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deep\_dba](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@deep\_dba](https://discuss.elastic.co/u/deep_dba)\
**Post date:** [March 20, 2020, 11:56am UTC](https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412/1 "2020-03-20T11:56:16Z")

</div>

Hello Team,  
We are trying to curl rest api to update password for admin user and also get roles but it is not giving any result. Can you please if syntex is right.

Below is the url we are using  
url [https://hostname](https://hostname):/app/kibana/GET/\_opendistro/\_security/api/roles/ -u admin:password

---

<div class="post-metadata">

**Author:** ![deep\_dba](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@deep\_dba](https://discuss.elastic.co/u/deep_dba)\
**Post date:** [March 20, 2020, 12:48pm UTC](https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412/2 "2020-03-20T12:48:57Z")

</div>

When i use below i am able to authenticate but getting below error  
\< HTTP/1.1 404 Not Found  
\< kbn-name: kibana  
\< content-type: application/json; charset=utf-8  
\< cache-control: no-cache  
\< set-cookie: security\_authentication=Fe26.2 **9183c9a6a30176d14ec51be196b47acfcaf02608c1fe1c6c7698e89e6fee2b82_C2vzmi4j3jsJQ3F\_luDhng_RXGicQkJVFJbKk6Lke6kooOWsayYQ80n\_2R5dhBLq3idtyAWV4v3njW0JZSAiew3OmSbFpfujMX3vcuhPN-RbLuJsXXDNMB6tIlFbTdhKMfBZ9LhKdqdk0-CBthPiPx\_Nxd4WiVF9yTinLcDgHWH\_ZtfG-KGkwOx3OJcx1vSuC59ku9tHF57zd-jG\_QteXKNlj2NyUd8Kboexv2P8SjCeQ** 15b4794471d9a65b34796dcf77fdf95e4f9a06bc7a1ba3a8cbb0e34dcbaed623_j-n5XET-N0xvbNv8karAaGoPUQ8Sa-HySKFHTgbOTwo; Max-Age=3600; Expires=Fri, 20 Mar 2020 13:03:41 GMT; HttpOnly; Path=/  
\< set-cookie: security\_storage=Fe26.2\*\*178f78a715faf99bed6f7801d5e1067a640ac5ac8142a2fcaf546386d27f9561_7OJFsg\_CJ-mlvC1VFQugjQ_TwqZKhlPJEIbp5kh8kETNh1nYYJHXvw2Van8lSnHoy2tzSxmTbgkCQ7H2TBpewnIQqp39kgPXspjfHqhlrK6\_xGPFrp-dKscU7IGpyDaRJvAa-ScpykYHh2I\_TGV0VvopSsjGMdnoTFfB\_\_pvYc004U386YLC-DwRQC\_3-yOpMEVi3Bz4mYbgGObbzN2rtHagC\_TbcBsO2CpCk0V7YS5mApT-czmWsDZcBCwMIBZ8Uo\*\*60f5184c35df3a907abb170cc1e9de9e185581a084166c9f753bc507debd3f09_40yvombyyzftPH9HGF\_dEscq02GlbS\_auu9m0-OzkSE; HttpOnly; Path=/  
\< content-length: 60  
\< connection: close  
\< Date: Fri, 20 Mar 2020 12:03:41 GMT  
\<

- Closing connection 0  
Please help

---

<div class="post-metadata">

**Author:** ![deep\_dba](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@deep\_dba](https://discuss.elastic.co/u/deep_dba)\
**Post date:** [March 20, 2020, 3:05pm UTC](https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412/3 "2020-03-20T15:05:16Z")

</div>

How we will get know as what is the url folder structure?

---

<div class="post-metadata">

**Author:** ![Mikhail\_Shustov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikhail_shustov/32/49186_2.png) [@Mikhail\_Shustov](https://discuss.elastic.co/u/Mikhail_Shustov)\
**Post date:** [March 23, 2020, 5:14pm UTC](https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412/4 "2020-03-23T17:14:24Z")

</div>

Hi, @deep_dba  
OpenDistro is not an Elastic product or maintained or supported by us. You can leave the question here open and maybe someone from the community has a similar issue and will be able to help, but we're sorry that we are not always able to help out with third party products. In general I would recommend you to ask that question in the OpenDistro forums or to their support.

---

<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:** [April 20, 2020, 5:17pm UTC](https://discuss.elastic.co/t/using-rest-api-in-curl-command/224412/5 "2020-04-20T17:17:36Z")

</div>

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