# Rest API: load the color details with mapping

**URL:** <https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081>\
**Category:** Kibana\
**Created:** [April 11, 2022, 9:06am UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081 "2022-04-11T09:06:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![octagon.mobile](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/octagon.mobile/32/62316_2.png) [@octagon.mobile](https://discuss.elastic.co/u/octagon.mobile)\
**Post date:** [April 11, 2022, 9:06am UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081/1 "2022-04-11T09:06:22Z")

</div>

The Rest API [Bulk Get](https://www.elastic.co/guide/en/kibana/7.9/saved-objects-api-bulk-get.html) ( **api/saved\_objects/\_bulk\_get** ) doesn't return the colors used in a pie chart, unless user updates the color of pie chart slice.

With default colors the response "_ **uiStateJSON** _" is empty **{}**

But when I update a particular slice color then the response looks like:

```auto
{"uiStateJSON": "{\"vis\":{\"colors\":{\"Kibana Airlines\":\"#E5AC0E\"}}}"}

```

How do I load all the colors with mapping?

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [April 12, 2022, 7:06am UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081/2 "2022-04-12T07:06:05Z")

</div>

Hi  
AFAIK this is not possible without changing the colors, like you mentioned. Default colors are not persisted using saved\_objects. What's your use case for this?

Best,  
Matthias

---

<div class="post-metadata">

**Author:** ![octagon.mobile](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/octagon.mobile/32/62316_2.png) [@octagon.mobile](https://discuss.elastic.co/u/octagon.mobile)\
**Post date:** [April 12, 2022, 10:07am UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081/3 "2022-04-12T10:07:26Z")

</div>

I am using the REST API to create a custom pie chart on a mobile application, I want to map the colors used in pie slices. if I get all the colors with mapping under `uiStateJSON` I can use the same colors for my custom Pie chart slices

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [April 12, 2022, 5:35pm UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081/4 "2022-04-12T17:35:00Z")

</div>

Got it, thx. Sadly we don't provide this functionally, since it doesn't make sense to persist default settings. So you would need to implement your way of color mapping to ours to make it similar in this case.  
Best,  
Matthias

---

<div class="post-metadata">

**Author:** ![octagon.mobile](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/octagon.mobile/32/62316_2.png) [@octagon.mobile](https://discuss.elastic.co/u/octagon.mobile)\
**Post date:** [April 13, 2022, 8:06am UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081/5 "2022-04-13T08:06:11Z")

</div>

Got it, Thank you 🙂 @matw

---

<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 11, 2022, 8:06am UTC](https://discuss.elastic.co/t/rest-api-load-the-color-details-with-mapping/302081/6 "2022-05-11T08:06:48Z")

</div>

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