# Rest API

**URL:** https://discourse.orthanc-server.org/t/rest-api/670
**Category:** Google Groups archive
**Created:** [May 7, 2017, 9:17am UTC](https://discourse.orthanc-server.org/t/rest-api/670 "2017-05-07T09:17:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![seenivasan\_venkatasa](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@seenivasan\_venkatasa](https://discourse.orthanc-server.org/u/seenivasan_venkatasa)
#### Post date: [May 7, 2017, 9:17am UTC](https://discourse.orthanc-server.org/t/rest-api/670/1 "2017-05-07T09:17:30Z")

</div>

First of all I immensely thank the people behind this wonderful software.

My question is about Rest API.

When I am doing **patient level queries ,** the returned JSON objects is not containing **ID**.

When i am doing “/patients?expand”, the returned JSON objects contain **ID**.

This becomes great obstacle for me to do some filtering and as well as to reduce the number of patients displayed in the index page.

I would be grateful if any one helps in this regard.

Regards…

---

<div class="post-metadata">

### Author: ![Thibault\_Nelis](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Thibault\_Nelis](https://discourse.orthanc-server.org/u/Thibault_Nelis)
#### Post date: [May 8, 2017, 9:02am UTC](https://discourse.orthanc-server.org/t/rest-api/670/2 "2017-05-08T09:02:06Z")

</div>

Hello,

> When I am doing patient level queries , the returned JSON objects is  
> not containing ID .

Do you mean DICOM C-FIND queries via /queries, Orthanc queries via  
/tools/find, or simply patient listing via /patients?

> When i am doing "/patients?expand", the returned JSON objects  
> contain ID.

Note that /patients does also without the expand parameter; unless you  
mean something else than the patient ID?

> This becomes great obstacle for me to do some filtering and as well  
> as to reduce the number of patients displayed in the index page.

If you want to do server-side filtering of Orthanc resources, I believe  
you're looking for /tools/find.

---

<div class="post-metadata">

### Author: ![seenivasan\_venkatasa](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@seenivasan\_venkatasa](https://discourse.orthanc-server.org/u/seenivasan_venkatasa)
#### Post date: [May 8, 2017, 10:51am UTC](https://discourse.orthanc-server.org/t/rest-api/670/3 "2017-05-08T10:51:12Z")

</div>

Thanks much **Thibault Nelis** for your response.

_Do you mean DICOM C-FIND queries via /queries, Orthanc queries via_

_/tools/find, or simply patient listing via /patients?_

Yes I meant DICOM C-FIND queries via /queries. But that do not fetch Patient ID assigned by Orthanc.

_Note that /patients does also without the expand parameter; unless you_  
_mean something else than the patient ID?_

The expand parameter is used by Orthanc in its explorer to fetch all patients with their IDs. It is becoming slow as patient count increases.

_If you want to do server-side filtering of Orthanc resources, I believe_  
_you’re looking for /tools/find._

If you do not bother to spare some time , can you provide some working examples to use /tools/find through HTTP.

Thank you **Thibault Nelis.**

---

<div class="post-metadata">

### Author: ![seenivasan\_venkatasa](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/9de0a6/32.png) [@seenivasan\_venkatasa](https://discourse.orthanc-server.org/u/seenivasan_venkatasa)
#### Post date: [May 8, 2017, 11:39am UTC](https://discourse.orthanc-server.org/t/rest-api/670/4 "2017-05-08T11:39:19Z")

</div>

> I got tools/find working by posting a JSON object with following format

`  
{“Level”:“Patients”,“Query”:{“PatientID”:“9\*”,“PatientName”:“\*”}}

`

Thank you.

---

<div class="post-metadata">

### Author: ![Thibault\_Nelis](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Thibault\_Nelis](https://discourse.orthanc-server.org/u/Thibault_Nelis)
#### Post date: [May 8, 2017, 11:52am UTC](https://discourse.orthanc-server.org/t/rest-api/670/5 "2017-05-08T11:52:27Z")

</div>

Yes that is normal, C-FIND requests are sent to arbitrary DICOM  
modalities which are not necessarily Orthanc servers and hence do not  
have Orthanc IDs assigned to the target resources.

Looking at your other message I believe you found what you were looking  
for with /tools/find to issue similar requests to Orthanc servers.  
Don't hesitate if I seem to have misunderstood.
