# Rest api - objects of specific type

**URL:** <https://community.datagerry.com/t/rest-api-objects-of-specific-type/561>\
**Category:** Community Support\
**Created:** [March 1, 2024, 11:44am UTC](https://community.datagerry.com/t/rest-api-objects-of-specific-type/561 "2024-03-01T11:44:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iosu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/iosu/32/775_2.png) [@iosu](https://community.datagerry.com/u/iosu)\
**Post date:** [March 1, 2024, 11:44am UTC](https://community.datagerry.com/t/rest-api-objects-of-specific-type/561/1 "2024-03-01T11:44:48Z")

</div>

Alo everybody!  
first of all, i’ve been using datagerry for some days now in an evaluation purpose and i find it pretty useful, thx for it!!

OTOH, m currently working on a basic script that matches what datagerry contains with the resource listing from AWS and warns if a mismatch is found and im trying to get the list of objects of a specific type through the rest api (datagerry version 2.0),

i but the url i’ve read in another topic does not seem to work (404, the place of the blind squirrel 😃 )

[http://localhost:4000/rest/objects/type/1](http://localhost:4000/rest/objects/type/1)  
(tried will all combinations of object/type, objects/type, objects/types, objects/type,…)

is there any way to get this list?

thanks!

---

<div class="post-metadata">

**Author:** ![iosu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/iosu/32/775_2.png) [@iosu](https://community.datagerry.com/u/iosu)\
**Post date:** [March 1, 2024, 11:59am UTC](https://community.datagerry.com/t/rest-api-objects-of-specific-type/561/2 "2024-03-01T11:59:41Z")

</div>

i can reply to myself, as @kent got the right answer in another post

> [@API - GET all objects of a type](https://community.datagerry.com/t/api-get-all-objects-of-a-type/435/2):
>
> This is how I have been doing it  
> /rest/objects/?limit=10000&filter={“type\_id”:X}
> 
> Where X is the ID of the type you want to filter.

which in my python script translates to

```auto
resp = requests.post(CMDB_LOGIN_URL, headers=CMDB_LOGIN_HEADERS, json=CMDB_LOGIN_DATA)
token = resp.json()['token']
auth_header = {"Authorization": f"Bearer {token}"}
myfilter = {'type_id': 1}
params = { 
        "filter": json.dumps(myfilter)
        }
resp = requests.get(CMDB_VPCS_URL, headers=auth_header, params=params)

```
