# Starting with the REST API

**URL:** <https://community.datagerry.com/t/starting-with-the-rest-api/135>\
**Category:** Community Support\
**Created:** [June 24, 2020, 2:55pm UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135 "2020-06-24T14:55:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/jeremy/32/219_2.png) [@Jeremy](https://community.datagerry.com/u/Jeremy)\
**Post date:** [June 24, 2020, 2:55pm UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/1 "2020-06-24T14:55:22Z")

</div>

Hello,

I’m trying to research datagerry to see if it’s suitable for for us. Though I’m blocked on the REST API trying to query out objects.

Though I can’t find the URL or path to query. I’ve read this several times: [https://docs.datagerry.com/latest/api/rest/index.html](https://docs.datagerry.com/latest/api/rest/index.html) but it dose not explain what “module” is or how to query an object.

Is there a howto or example for using the REST API ?

Thanks  
J

---

<div class="post-metadata">

**Author:** ![marcinw](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@marcinw](https://community.datagerry.com/u/marcinw)\
**Post date:** [June 25, 2020, 9:11am UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/2 "2020-06-25T09:11:51Z")

</div>

Hi @Jeremy  
i think You can use:  
curl -s -u user:password [https://eewid.gkpge.pl/rest/object/](https://eewid.gkpge.pl/rest/object/) - show all objects  
curl -s -u user:password [https://eewid.gkpge.pl/rest/object/1](https://eewid.gkpge.pl/rest/object/1) - show object with id 1  
if use “type” instead of “object” you could show types

---

<div class="post-metadata">

**Author:** ![Jeremy](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/jeremy/32/219_2.png) [@Jeremy](https://community.datagerry.com/u/Jeremy)\
**Post date:** [June 25, 2020, 10:55am UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/3 "2020-06-25T10:55:18Z")

</div>

Hello @marcinw that is what I was looking for, thank you. 😀

---

<div class="post-metadata">

**Author:** ![marcinw](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@marcinw](https://community.datagerry.com/u/marcinw)\
**Post date:** [June 25, 2020, 11:51am UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/4 "2020-06-25T11:51:17Z")

</div>

@Jeremy  
No problem, i knowed so i wrote it 🙂

---

<div class="post-metadata">

**Author:** ![kbetsis](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kbetsis](https://community.datagerry.com/u/kbetsis)\
**Post date:** [October 14, 2020, 12:26pm UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/5 "2020-10-14T12:26:56Z")

</div>

Hi all

Is there a way i can get objects of a specific type through an API call?  
As to then get the desired object ID?

Thank you  
Best Regards  
Konstantinos Betsis

---

<div class="post-metadata">

**Author:** ![mbatz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/mbatz/32/5_2.png) [@mbatz](https://community.datagerry.com/u/mbatz)\
**Post date:** [October 15, 2020, 10:04am UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/6 "2020-10-15T10:04:34Z")

</div>

Hi @kbetsis,

you can use the following REST call to get all objects of a specific type:

```
curl -u user:password http://127.0.0.1:4000/rest/object/type/<typeID>

```

An other option is to use the [Exportd ExternalSystemGenericPullJson](https://docs.datagerry.com/1.3.2/admin_guide/exportd.html#externalsystemgenericpulljson) plugin (long word 🙂 ). With that, you can define a JSON output with a custom structure.

---

<div class="post-metadata">

**Author:** ![kbetsis](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kbetsis](https://community.datagerry.com/u/kbetsis)\
**Post date:** [January 18, 2021, 6:30pm UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/7 "2021-01-18T18:30:51Z")

</div>

Hi @mbatz

Happy new year with lots of wishes for health, happiness and everything you wish for you, your family and colleagues.

I am trying to create some custom endpoint, as mentioned above “ExternalSystemGenericPullJson”, as to enable a more “user friendly” API for users to get the necessary information.

I have successfully created two API calls, one for objects type A and one for objects type B.  
Type B has a parent relationship with Type A, like branches with routers.

So in theory one would be able to GET all branches through an API call and by selecting the desired branch\_id = branches object\_id he could use it to get all routers attached to that branch.

However, when I issue the second API and put as a query parameter the branch\_id i still get all type B results without any filtering.

How, can I filter the results of JSON pull through the value of one variable and only get all results that have the requested variable included?

Thank you

---

<div class="post-metadata">

**Author:** ![mojoaar](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/mojoaar/32/516_2.png) [@mojoaar](https://community.datagerry.com/u/mojoaar)\
**Post date:** [March 24, 2021, 2:30pm UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/8 "2021-03-24T14:30:02Z")

</div>

Hi,

Did something change? If I do /rest/object/ I just get told that the method is not allowed. I’m just trying to list alle objects - no matter of the type they have.

curl -u username:password [http://xxx.yyy.com:4000/rest/object/](http://xxx.yyy.com:4000/rest/object/)  
{“description”:“The method is not allowed for the requested URL.”,“joke”:“to not be able to do something for toffee/nuts.”,“message”:"",“response”:“Method Not Allowed: [http://xxx.yyy.com:4000/rest/object/","status](http://xxx.yyy.com:4000/rest/object/%22,%22status)”:405}

Using version 1.5.2.

Regards  
Morten

---

<div class="post-metadata">

**Author:** ![mojoaar](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/mojoaar/32/516_2.png) [@mojoaar](https://community.datagerry.com/u/mojoaar)\
**Post date:** [March 24, 2021, 2:36pm UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/9 "2021-03-24T14:36:44Z")

</div>

I can answer my own questions. The URL is /rest/objects/ and not /rest/object/ as mentioned above. Cant say if it’s a change or allways have been with the “S”.

---

<div class="post-metadata">

**Author:** ![adnan.smajic](https://dub1.discourse-cdn.com/flex013/user_avatar/community.datagerry.com/adnan.smajic/32/754_2.png) [@adnan.smajic](https://community.datagerry.com/u/adnan.smajic)\
**Post date:** [June 20, 2023, 10:43am UTC](https://community.datagerry.com/t/starting-with-the-rest-api/135/10 "2023-06-20T10:43:39Z")

</div>


