# External API Call in kibana 7.10.2

**URL:** <https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378>\
**Category:** Kibana\
**Created:** [June 9, 2021, 6:18am UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378 "2021-06-09T06:18:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi\_yadav2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_yadav2/32/61530_2.png) [@ravi\_yadav2](https://discuss.elastic.co/u/ravi_yadav2)\
**Post date:** [June 9, 2021, 6:18am UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378/1 "2021-06-09T06:18:47Z")

</div>

Hi Team,

How i can make API call to our external API. I tried to use fetch , but it misses complete cookies list in the request header.

Is there any service already present in Kibana which i can reuse.  
**Trying to make call from src\core\public\chrome\ui\header\header.tsx to external API.**

Please help team! Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [June 9, 2021, 7:18am UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378/2 "2021-06-09T07:18:33Z")

</div>

> it misses complete cookies list in the request header.

Do you mean the cookies for your external API? If yes you probably need to set `credentials: 'include'` on the fetch call: [Using the Fetch API - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#sending_a_request_with_credentials_included)

---

<div class="post-metadata">

**Author:** ![ravi\_yadav2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_yadav2/32/61530_2.png) [@ravi\_yadav2](https://discuss.elastic.co/u/ravi_yadav2)\
**Post date:** [June 9, 2021, 8:42am UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378/3 "2021-06-09T08:42:26Z")

</div>

@flash1293  
Thanks for quick reply  
Atually for other rest api calls in kibana we have multiple cookies in request header  
something like:  
Cookie:  
JSESSIONID=7D1026E51294445448132A0E7F0E7188F5; JSESSIONID=942B9049AA036DF45468B97C077C366E8;  
I want to send multiple cookies in case of external API under request header.  
when using credentials: 'include' , it just sends a single cookie(first one) as a result api gets failed.

---

<div class="post-metadata">

**Author:** ![ravi\_yadav2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_yadav2/32/61530_2.png) [@ravi\_yadav2](https://discuss.elastic.co/u/ravi_yadav2)\
**Post date:** [June 9, 2021, 6:38pm UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378/5 "2021-06-09T18:38:16Z")

</div>

Any idea why it is not sending all the cookie?

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [June 10, 2021, 12:11pm UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378/6 "2021-06-10T12:11:06Z")

</div>

I don't think this is related to Kibana - for this kind of request it's just a CORS request like any other. Please try to make a similar request from within another web app (not hosted on the same host as the external api) - I suspect it will have the same issue.

---

<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:** [July 8, 2021, 12:11pm UTC](https://discuss.elastic.co/t/external-api-call-in-kibana-7-10-2/275378/7 "2021-07-08T12:11:31Z")

</div>

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