# How to get entities only that have problems using API?

**URL:** <https://community.dynatrace.com/t/how-to-get-entities-only-that-have-problems-using-api/38910>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [March 20, 2023, 5:21pm UTC](https://community.dynatrace.com/t/how-to-get-entities-only-that-have-problems-using-api/38910 "2023-03-20T17:21:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamstelus](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jamstelus](https://community.dynatrace.com/u/jamstelus)\
**Post date:** [March 20, 2023, 5:21pm UTC](https://community.dynatrace.com/t/how-to-get-entities-only-that-have-problems-using-api/38910/1 "2023-03-20T17:21:08Z")

</div>

Does anyone know how to get a list of entities that have problems “only”?

What endpoint to be used with parameters? if it is possible please show me example,

Thanks

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [March 20, 2023, 5:34pm UTC](https://community.dynatrace.com/t/how-to-get-entities-only-that-have-problems-using-api/38910/2 "2023-03-20T17:34:34Z")

</div>

Do you mean the only entities that have open problems? If so: you could you the normal problem api. These APIs give information about impacted entities / root causes etcetera.

Using a small script you can easily get a result that provides exactly what you’ll need.

> **[Problems API v2 - GET problems list](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/problems-v2/problems/get-problems-list)**
>
> Fetch the list of problems via Problems v2 API.

Kind regards,

Michiel

---

<div class="post-metadata">

**Author:** ![McVitas](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@McVitas](https://community.dynatrace.com/u/McVitas)\
**Post date:** [September 19, 2023, 12:07pm UTC](https://community.dynatrace.com/t/how-to-get-entities-only-that-have-problems-using-api/38910/3 "2023-09-19T12:07:23Z")

</div>

Hello. I am trying similar thing: I want to list all open problems but only with some fields. I want problem title and hostname. Unfortunately I can’t get the hostname into the resulting JSON. I tried name, hostname, but it doesn’t put it there and I get result completely without hostnames or with hostnames but also with many other information which I don’t want. The best thing would be to be able to get a CSV format result, but I guess this is not possible?

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [September 19, 2023, 3:48pm UTC](https://community.dynatrace.com/t/how-to-get-entities-only-that-have-problems-using-api/38910/4 "2023-09-19T15:48:39Z")

</div>

Hi there,

So basically the API gives you a LOT of field. You can’t reduce this according to the documentation:

| A list of additional problem properties you can add to the response.The following properties are available ( **all other properties are always included and you can't remove them from the response** 😞
- evidenceDetails: The details of the root cause.
- impactAnalysis: The impact analysis of the problem on other entities/users.
- recentComments: A list of the most recent comments to the problem.

To add properties, specify them as a comma-separated list (for example, evidenceDetails,impactAnalysis). |

Second part is the question about HOST. What do you want to know exactly? The root cause?  
In the JSON response there will be something like this:

```auto
rootCauseEntity": { "entityId": { "id": "PROCESS_GROUP-511F9ECC59F68DD4", "type": "PROCESS_GROUP"
        },
        "name": "Oracle Database"
      }

```

In case this is a HOST, you will have the host ID there. If you want to customize something to XML, you’ll probably need to write a simple custom script.

by the way: adding field **evidenceDetails** can give you more infomation about the host.
