# Settings API - GET objects

**URL:** <https://community.dynatrace.com/t/settings-api-get-objects/39780>\
**Category:** Dynatrace API\
**Tags:** settings, dynatrace-api\
**Created:** [May 17, 2023, 10:55am UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780 "2023-05-17T10:55:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pooja\_3](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@Pooja\_3](https://community.dynatrace.com/u/Pooja_3)\
**Post date:** [May 17, 2023, 10:55am UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780/1 "2023-05-17T10:55:57Z")

</div>

Hi Team,

I am trying to execute get objects API but not sure what to enter in&nbsp;schemaIds, how can I find schemaID to get list of one agent deployed&nbsp;list.

Thanks and Regards

Pooja P

---

<div class="post-metadata">

**Author:** ![Naveen](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/naveen/32/2570_2.png) [@Naveen](https://community.dynatrace.com/u/Naveen)\
**Post date:** [May 17, 2023, 11:18am UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780/2 "2023-05-17T11:18:29Z")

</div>

Hi Pooja,

You can use v2 Settings API to get the list of all the available schemas.

**API:** &nbsp;https://{environmentid}.live.dynatrace.com/api/v2/settings/schemas

**Response:**

```javascript
{
  "schemaId": "builtin:monitored-technologies.php",
  "displayName": "PHP",
  "latestSchemaVersion": "0.0.3"
}

```

You can use above _schemaId_ to get or update the objects.

**Reference:** &nbsp;[Settings API - GET all schemas — Dynatrace Docs](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/schemas/get-all)

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [May 17, 2023, 7:54pm UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780/3 "2023-05-17T19:54:25Z")

</div>

Hi&nbsp;[@Pooja\_3](https://community.dynatrace.com/user/57187),

I don’t know if you are looking for the list of deployed hosts or if you just need the OneAgent default&nbsp;version, if you are looking for the list of hosts, you need to use entity API not settings API.

entity API v2:

/api/v2/entities?entitySelector=type(host)&fields=+properties.osType,+properties.monitoringMode

or you can use API v1:

/api/v1/entity/infrastructure/hosts

as for settings API, you can find all the&nbsp;available schemas [here](https://www.dynatrace.com/support/help/shortlink/settings20-available-schemas)

---

<div class="post-metadata">

**Author:** ![Pooja\_3](https://avatars.discourse-cdn.com/v4/letter/p/7bcc69/32.png) [@Pooja\_3](https://community.dynatrace.com/u/Pooja_3)\
**Post date:** [May 18, 2023, 1:10am UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780/4 "2023-05-18T01:10:50Z")

</div>

thanks&nbsp;[@Naveen](https://community.dynatrace.com/user/51963)&nbsp;and&nbsp;[@Mohamed\_Hamdy](https://community.dynatrace.com/user/4007)&nbsp;- I am able to get the list of schema IDs. Basically, I am trying to get list of hosts on which one agents is deployed in last 3 months. From UI I can’t option to save that list. My requirement is to block the traffic of certain IPs with same subnet but we have few ECS containers where one agent is deployed. We can block traffic at IP level but at API level it’s quite difficult. If you have better solution for this, it would be helpful.

---

<div class="post-metadata">

**Author:** ![Naveen](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/naveen/32/2570_2.png) [@Naveen](https://community.dynatrace.com/u/Naveen)\
**Post date:** [May 18, 2023, 4:45am UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780/5 "2023-05-18T04:45:12Z")

</div>

Hi [@Pooja\_3](https://community.dynatrace.com/user/57187)&nbsp;,

I am not sure what exactly you trying to do, but you can use&nbsp; **api/v1/oneagents?includeDetails=false** API to get the list of host where oneagent is installed and save it as a JSON file. Could you please share the API you are using.

Trying using script may be bash or powershell.

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [May 18, 2023, 8:35am UTC](https://community.dynatrace.com/t/settings-api-get-objects/39780/6 "2023-05-18T08:35:22Z")

</div>

[@Naveen](https://community.dynatrace.com/user/51963)&nbsp;, I think&nbsp;[@Pooja\_3](https://community.dynatrace.com/user/57187)&nbsp;is looking for this, but for the last three months, so you can use the following as well:

/api/v1/oneagents?includeDetails=false&startTimestamp=1679097600000&endTimestamp=1684368000000

for more details check [OneAgent on Host API](https://www.dynatrace.com/support/help/shortlink/api-oneagent-on-host)

to convert timestamps to milliseconds use [this](https://www.epochconverter.com/)
