# extract hosts in excel or csv

**URL:** <https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951>\
**Category:** Open Q&A\
**Tags:** hosts-classic\
**Created:** [April 2, 2020, 2:33pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951 "2020-04-02T14:33:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahima\_goel](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mahima\_goel](https://community.dynatrace.com/u/mahima_goel)\
**Post date:** [April 2, 2020, 2:33pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/1 "2020-04-02T14:33:22Z")

</div>

I want to extract all the list of hosts in a excel or csv file for a Saas

---

<div class="post-metadata">

**Author:** ![justin\_hogue](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/justin_hogue/32/19679_2.png) [@justin\_hogue](https://community.dynatrace.com/u/justin_hogue)\
**Post date:** [April 2, 2020, 3:13pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/2 "2020-04-02T15:13:05Z")

</div>

Hello,

One way to do this would be to utilize the Environment API v1. Under Topology & Smartscape you can grab a list of all available hosts in your environment and then download a json file for the given output. You can then convert that json data into a table in excel.

 ![24474-1585840208532.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/c/1c23d49e02c2ca304b194b24671811d833052ceb.png)

 ![24465-1585840286275.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/a/0af714d0ea29993eb7e66e994eb413639746a2dd.png)

Here is a link that explains how to convert the json data in exel that might be useful.

> **[Audit Log API - How to Convert Json Data to Excel](https://community.dynatrace.com/t5/Dynatrace-tips/Audit-Log-API-How-to-Convert-Json-Data-to-Excel/m-p/126756)**
>
> Many people have asked how to convert Json Files into Excel. Follow these simple stepson how to get started.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![mahima\_goel](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mahima\_goel](https://community.dynatrace.com/u/mahima_goel)\
**Post date:** [April 2, 2020, 3:21pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/3 "2020-04-02T15:21:52Z")

</div>

Is this mean I don’t have permissions?

 ![capture.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/f/1f17f64c3f915626c757be47bf5cfd2fa39bf37c.png)

---

<div class="post-metadata">

**Author:** ![justin\_hogue](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/justin_hogue/32/19679_2.png) [@justin\_hogue](https://community.dynatrace.com/u/justin_hogue)\
**Post date:** [April 2, 2020, 3:29pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/4 "2020-04-02T15:29:23Z")

</div>

Did you authorize with an API token that has the correct permissions?

 ![24439-1585841326620.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/c/7cbda9aa4bd6842a0a042817c57a9b79dec8faa2.png)

---

<div class="post-metadata">

**Author:** ![justin\_hogue](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/justin_hogue/32/19679_2.png) [@justin\_hogue](https://community.dynatrace.com/u/justin_hogue)\
**Post date:** [April 2, 2020, 3:34pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/5 "2020-04-02T15:34:32Z")

</div>

To do this you’ll need to go to Settings \> Integration \> Dynatrace API. You’ll then need to generate a token with the following permission: Access problem and event feed, metrics, and topology. Then copy the generated token and use it to authorize that API by clicking the lock icon and adding the copied token into the box labeled Value. After that authorize the token and then try to execute that API again.

---

<div class="post-metadata">

**Author:** ![mahima\_goel](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mahima\_goel](https://community.dynatrace.com/u/mahima_goel)\
**Post date:** [April 2, 2020, 4:00pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/6 "2020-04-02T16:00:20Z")

</div>

Did as you said, but still receiving same error

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [April 2, 2020, 8:48pm UTC](https://community.dynatrace.com/t/extract-hosts-in-excel-or-csv/18951/7 "2020-04-02T20:48:31Z")

</div>

Hey, You will need to create an API token like this one:

 ![24447-token-1.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/7/2/725bb3036ac0d27880d8aa260e4e49f17fcd67e3.jpeg)

You will need to copy that token code an authorize the API:

 ![24477-token-2.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/6/2/620acb84c8b83db3c8383de2dd1d31640ca2825c.jpeg)

Then make sure you select Try it out!

 ![24454-token-3.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/d/0/d0fbe5b0dff31b8c1e93f4f5c872c73275b9f85c.jpeg)

Let me know if you get an error and we can work through it.
