# How to access Kibana APIs

**URL:** https://discuss.elastic.co/t/how-to-access-kibana-apis/218171
**Category:** Beats
**Tags:** metricbeat
**Created:** [February 6, 2020, 12:36pm UTC](https://discuss.elastic.co/t/how-to-access-kibana-apis/218171 "2020-02-06T12:36:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SathishPrakasam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sathishprakasam/32/46290_2.png) [@SathishPrakasam](https://discuss.elastic.co/u/SathishPrakasam)
#### Post date: [February 6, 2020, 12:36pm UTC](https://discuss.elastic.co/t/how-to-access-kibana-apis/218171/1 "2020-02-06T12:36:11Z")

</div>

Hi Team,

In metricbeat.yml we have a setting,

# Kibana Host

# Scheme and port can be left out and will be set to the default (http and 5601)

# In case you specify and additional path, the scheme is required: [http://localhost:5601/path](http://localhost:5601/path)

# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601

host: "[kibana-dp-dev.snm.syn.nesc.cmpn.net](http://kibana-dp-dev.snm.syn.nesc.cmpn.net)"  
username: "username"  
password: "password"  
protocol: "https"

In my orgnization port 5601 is no accessible from intranet.  
Kibana is running behind ngnix, [https://kibana-dp-dev.snm.syn.nesc.cmpn.net](https://kibana-dp-dev.snm.syn.nesc.cmpn.net).

When i run metribeat setup --dashboards in order to pull default dashboards on to Kibana, am getting below error.

Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to [https://kibana-dp-dev.snm.syn.nesc.cmpn.net:5601/api/status](https://kibana-dp-dev.snm.syn.nesc.cmpn.net:5601/api/status) fails: fail to execute the HTTP GET request: Get [https://kibana-dp-dev.snm.syn.nesc.cmpn.net:5601/api/status:](https://kibana-dp-dev.snm.syn.nesc.cmpn.net:5601/api/status:) dial tcp 10.129.594.201:5601: connect: connection refused. Response: .

in order to mitigate this problem i tried combination of urls like,

Direct HTTPs url:  
[https://username:password@kibana-dp-dev.snm.syn.nesc.cmpn.net/api/status](https://username:password@kibana-dp-dev.snm.syn.nesc.cmpn.net/api/status)

Invoking ngnix with user name and password:  
[http://username:password@kibana-dp-dev.snm.syn.nesc.cmpn.net:80/api/status](http://username:password@kibana-dp-dev.snm.syn.nesc.cmpn.net:80/api/status)

But both returns me below error,  
{"statusCode":401,"error":"Unauthorized","message":"Unauthorized"}

is there a way to access Kibana APIs by dynamically passing username and password?  
any help in correcting my configuration to pull metricbeat dashboard i smuch appreciated.

---

<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: [March 5, 2020, 12:36pm UTC](https://discuss.elastic.co/t/how-to-access-kibana-apis/218171/2 "2020-03-05T12:36:23Z")

</div>

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