# Case List and Case Data

**URL:** <https://forum.dimagi.com/t/case-list-and-case-data/1929>\
**Category:** Developers\
**Created:** [October 6, 2014, 3:09pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929 "2014-10-06T15:09:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.dimagi.com/u/Tim)\
**Post date:** [October 6, 2014, 3:09pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/1 "2014-10-06T15:09:33Z")

</div>

Hi,

I am struggling with both of these API calls at present.

Case List  
[https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=0&limit=100&format=xml&type=xxxxx](https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=0&limit=100&format=xml&type=xxxxx)

Works fine but if I add closed=any or closed=true I get a very shortened  
XML with no cases.  
[https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=0&limit=100&format=xml&type=xxxxx&](https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=0&limit=100&format=xml&type=xxxxx&)  
closed=any

Am I missing something or is there another way to get all open and closed  
cases?

Case Data  
[https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/xxxxxxxxxxxxxxxxxxx/?format=xml&properties=all&indices=all](https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/xxxxxxxxxxxxxxxxxxx/?format=xml&properties=all&indices=all)  
This gives me the case information but not the form information for the  
case as shown here:  
[https://confluence.dimagi.com/display/commcarepublic/Case+Data](https://confluence.dimagi.com/display/commcarepublic/Case+Data)

Again, am I missing something or is there another way to get the forms used  
to submit the case? A little like the Case List \> Case History report works?

Much Thanks in Advance

Tim

---

<div class="post-metadata">

**Author:** ![Tim](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.dimagi.com/u/Tim)\
**Post date:** [October 6, 2014, 3:20pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/2 "2014-10-06T15:20:12Z")

</div>

Sorry Updated the call to include the &xforms\_by\_name\_\_full=true call 🙂

> **···**
>
> On Monday, October 6, 2014 4:09:33 PM UTC+1, Tim Butler wrote: \> \> Hi, \> \> I am struggling with both of these API calls at present. \> \> Case List \> \> https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=0&limit=100&format=xml&type=xxxxx \> \> Works fine but if I add closed=any or closed=true I get a very shortened \> XML with no cases. \> \> https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=0&limit=100&format=xml&type=xxxxx& \> closed=any \> \> Am I missing something or is there another way to get all open and closed \> cases? \> \> Case Data \> \> https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/xxxxxxxxxxxxxxxxxxx/?format=xml&properties=all&indices=all&xforms\_by\_name\_\_full=true \> This gives me the case information but not the form information for the \> case as shown here: \> https://confluence.dimagi.com/display/commcarepublic/Case+Data \> \> Again, am I missing something or is there another way to get the forms \> used to submit the case? A little like the Case List \> Case History report \> works? \> \> Much Thanks in Advance \> \> Tim \> \> \> \> \> \> \> \> \>

---

<div class="post-metadata">

**Author:** ![czue](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/czue/32/493_2.png) [@czue](https://forum.dimagi.com/u/czue)\
**Post date:** [October 6, 2014, 4:24pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/3 "2014-10-06T16:24:58Z")

</div>

Hey,

The default result set should include all open and closed cases. Adding  
closed=true or closed=false should split them out. ?closed=any is not  
supported (and it looks like the API is treating that the same as  
closed=true). Did you get that from somewhere in the docs? If so they  
should be updated.

Cory

> **···**
>
> On Mon, Oct 6, 2014 at 11:20 AM, Tim Butler wrote:
> 
> > Sorry Updated the call to include the &xforms\_by\_name\_\_full=true call 🙂
> > 
> > On Monday, October 6, 2014 4:09:33 PM UTC+1, Tim Butler wrote:
> > 
> > > Hi,
> > > 
> > > I am struggling with both of these API calls at present.
> > > 
> > > Case List  
> > > [https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=](https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=)  
> > > 0&limit=100&format=xml&type=xxxxx
> > > 
> > > Works fine but if I add closed=any or closed=true I get a very shortened  
> > > XML with no cases.  
> > > [https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=](https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/?offset=)  
> > > 0&limit=100&format=xml&type=xxxxx&closed=any
> > > 
> > > Am I missing something or is there another way to get all open and closed  
> > > cases?
> > > 
> > > Case Data
> > > 
> > > [https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/xxxxxxxxxxxxxxxxxxx/?format=xml&properties=all&indices=all&xforms\_by\_name\_\_full=true](https://www.commcarehq.org/a/xxxxxx/api/v0.4/case/xxxxxxxxxxxxxxxxxxx/?format=xml&properties=all&indices=all&xforms_by_name__full=true)  
> > > This gives me the case information but not the form information for the  
> > > case as shown here: [https://confluence.dimagi.com/](https://confluence.dimagi.com/)  
> > > display/commcarepublic/Case+Data
> > > 
> > > Again, am I missing something or is there another way to get the forms  
> > > used to submit the case? A little like the Case List \> Case History report  
> > > works?
> > > 
> > > Much Thanks in Advance
> > > 
> > > Tim
> > > 
> > > --
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "CommCare Developers" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [commcare-developers+unsubscribe@googlegroups.com](mailto:commcare-developers+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Tim](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.dimagi.com/u/Tim)\
**Post date:** [October 6, 2014, 7:35pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/4 "2014-10-06T19:35:37Z")

</div>

Hi Cory,

I tried both options, I will try again I'm the morning. The reference comes from the case list api docs.

Do you have a pointer on the case data api issue?

Much thanks in advance

Tim

---

<div class="post-metadata">

**Author:** ![Tim](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.dimagi.com/u/Tim)\
**Post date:** [October 7, 2014, 8:24am UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/5 "2014-10-07T08:24:47Z")

</div>

Hi Cory,

Checked the two options. False gives a list of open cases with their data,  
True gives a list of closed cases without their data or even their case  
name to use as a link.

Is it possible to have true give the same data as false?

Best

Tim

> **···**
>
> On Monday, October 6, 2014 8:35:37 PM UTC+1, Tim Butler wrote: \> \> Hi Cory, \> \> I tried both options, I will try again I'm the morning. The reference \> comes from the case list api docs. \> \> Do you have a pointer on the case data api issue? \> \> Much thanks in advance \> \> Tim \> \>

---

<div class="post-metadata">

**Author:** ![czue](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/czue/32/493_2.png) [@czue](https://forum.dimagi.com/u/czue)\
**Post date:** [October 7, 2014, 2:51pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/6 "2014-10-07T14:51:47Z")

</div>

Hi Tim,

This appears to be a bug in the XML version of the APIs. I've entered it  
into the system and assigned to our dev team and will update as soon as  
it's addressed.

Is there a reason you're using the XML version of th APIs? Generally we've  
found the JSON friendlier to work with (and the JSON version properly has  
properties for closed cases in the interim).

thanks,  
Cory

> **···**
>
> On Tue, Oct 7, 2014 at 4:24 AM, Tim Butler wrote:
> 
> > Hi Cory,
> > 
> > Checked the two options. False gives a list of open cases with their data,  
> > True gives a list of closed cases without their data or even their case  
> > name to use as a link.
> > 
> > Is it possible to have true give the same data as false?
> > 
> > Best
> > 
> > Tim
> > 
> > On Monday, October 6, 2014 8:35:37 PM UTC+1, Tim Butler wrote:
> > 
> > > Hi Cory,
> > > 
> > > I tried both options, I will try again I'm the morning. The reference  
> > > comes from the case list api docs.
> > > 
> > > Do you have a pointer on the case data api issue?
> > > 
> > > Much thanks in advance
> > > 
> > > Tim
> > > 
> > > --
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "CommCare Developers" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [commcare-developers+unsubscribe@googlegroups.com](mailto:commcare-developers+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Tim](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.dimagi.com/u/Tim)\
**Post date:** [October 7, 2014, 3:56pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/7 "2014-10-07T15:56:19Z")

</div>

Hi Cory,

Thanks for this - I can see that the JSON versions include the form data,  
so we will need to use these instead of the current code.

Back to the drawing board ☹

Best

Tim

> **···**
>
> On Tuesday, October 7, 2014 3:52:09 PM UTC+1, Cory Zue wrote: \> \> Hi Tim, \> \> This appears to be a bug in the XML version of the APIs. I've entered it \> into the system and assigned to our dev team and will update as soon as \> it's addressed. \> \> Is there a reason you're using the XML version of th APIs? Generally we've \> found the JSON friendlier to work with (and the JSON version properly has \> properties for closed cases in the interim). \> \> thanks, \> Cory \> \> On Tue, Oct 7, 2014 at 4:24 AM, Tim Butler \<tim.bu...@gmail.com \> wrote: \> \>\> Hi Cory, \>\> \>\> Checked the two options. False gives a list of open cases with their \>\> data, True gives a list of closed cases without their data or even their \>\> case name to use as a link. \>\> \>\> Is it possible to have true give the same data as false? \>\> \>\> Best \>\> \>\> Tim \>\> \>\> On Monday, October 6, 2014 8:35:37 PM UTC+1, Tim Butler wrote: \>\>\> \>\>\> Hi Cory, \>\>\> \>\>\> I tried both options, I will try again I'm the morning. The reference \>\>\> comes from the case list api docs. \>\>\> \>\>\> Do you have a pointer on the case data api issue? \>\>\> \>\>\> Much thanks in advance \>\>\> \>\>\> Tim \>\>\> \>\>\> -- \>\> \>\> --- \>\> You received this message because you are subscribed to the Google Groups \>\> "CommCare Developers" group. \>\> To unsubscribe from this group and stop receiving emails from it, send an \>\> email to commcare-developers+unsubscribe@googlegroups.com . \>\> For more options, visit https://groups.google.com/d/optout. \>\> \> \>

---

<div class="post-metadata">

**Author:** ![czue](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/czue/32/493_2.png) [@czue](https://forum.dimagi.com/u/czue)\
**Post date:** [October 7, 2014, 4:04pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/8 "2014-10-07T16:04:17Z")

</div>

Hey Tim,

Sorry about that. Please do feel free to update the docs or suggest updates  
wherever you've found something inconsistent.

Does this mean that it's no longer a priority to fix the closed case XML  
representation?

thanks,  
cory

> **···**
>
> On Tue, Oct 7, 2014 at 11:56 AM, Tim Butler wrote:
> 
> > Hi Cory,
> > 
> > Thanks for this - I can see that the JSON versions include the form data,  
> > so we will need to use these instead of the current code.
> > 
> > Back to the drawing board ☹
> > 
> > Best
> > 
> > Tim
> > 
> > On Tuesday, October 7, 2014 3:52:09 PM UTC+1, Cory Zue wrote:
> > 
> > > Hi Tim,
> > > 
> > > This appears to be a bug in the XML version of the APIs. I've entered it  
> > > into the system and assigned to our dev team and will update as soon as  
> > > it's addressed.
> > > 
> > > Is there a reason you're using the XML version of th APIs? Generally  
> > > we've found the JSON friendlier to work with (and the JSON version properly  
> > > has properties for closed cases in the interim).
> > > 
> > > thanks,  
> > > Cory
> > > 
> > > On Tue, Oct 7, 2014 at 4:24 AM, Tim Butler [tim.bu...@gmail.com](mailto:tim.bu...@gmail.com) wrote:
> > > 
> > > > Hi Cory,
> > > > 
> > > > Checked the two options. False gives a list of open cases with their  
> > > > data, True gives a list of closed cases without their data or even their  
> > > > case name to use as a link.
> > > > 
> > > > Is it possible to have true give the same data as false?
> > > > 
> > > > Best
> > > > 
> > > > Tim
> > > > 
> > > > On Monday, October 6, 2014 8:35:37 PM UTC+1, Tim Butler wrote:
> > > > 
> > > > > Hi Cory,
> > > > > 
> > > > > I tried both options, I will try again I'm the morning. The reference  
> > > > > comes from the case list api docs.
> > > > > 
> > > > > Do you have a pointer on the case data api issue?
> > > > > 
> > > > > Much thanks in advance
> > > > > 
> > > > > Tim
> > > > > 
> > > > > --
> > > > 
> > > > * * *
> > > > 
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "CommCare Developers" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [commcare-developers+unsubscribe@googlegroups.com](mailto:commcare-developers+unsubscribe@googlegroups.com).  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --
> > 
> > * * *
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "CommCare Developers" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [commcare-developers+unsubscribe@googlegroups.com](mailto:commcare-developers+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Tim](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/t/ce73a5/32.png) [@Tim](https://forum.dimagi.com/u/Tim)\
**Post date:** [October 8, 2014, 3:19pm UTC](https://forum.dimagi.com/t/case-list-and-case-data/1929/9 "2014-10-08T15:19:21Z")

</div>

Hi Cory,

I think having both options would be good.

We will rewrite our en, but I think having XML across the board is a good  
thing.

Best

Tim

> **···**
>
> On Tuesday, October 7, 2014 5:04:38 PM UTC+1, Cory Zue wrote: \> \> Hey Tim, \> \> Sorry about that. Please do feel free to update the docs or suggest \> updates wherever you've found something inconsistent. \> \> Does this mean that it's no longer a priority to fix the closed case XML \> representation? \> \> thanks, \> cory \> \> On Tue, Oct 7, 2014 at 11:56 AM, Tim Butler \<tim.bu...@gmail.com \> wrote: \> \>\> Hi Cory, \>\> \>\> Thanks for this - I can see that the JSON versions include the form data, \>\> so we will need to use these instead of the current code. \>\> \>\> Back to the drawing board :( \>\> \>\> Best \>\> \>\> Tim \>\> \>\> \>\> On Tuesday, October 7, 2014 3:52:09 PM UTC+1, Cory Zue wrote: \>\>\> \>\>\> Hi Tim, \>\>\> \>\>\> This appears to be a bug in the XML version of the APIs. I've entered it \>\>\> into the system and assigned to our dev team and will update as soon as \>\>\> it's addressed. \>\>\> \>\>\> Is there a reason you're using the XML version of th APIs? Generally \>\>\> we've found the JSON friendlier to work with (and the JSON version properly \>\>\> has properties for closed cases in the interim). \>\>\> \>\>\> thanks, \>\>\> Cory \>\>\> \>\>\> On Tue, Oct 7, 2014 at 4:24 AM, Tim Butler wrote: \>\>\> \>\>\>\> Hi Cory, \>\>\>\> \>\>\>\> Checked the two options. False gives a list of open cases with their \>\>\>\> data, True gives a list of closed cases without their data or even their \>\>\>\> case name to use as a link. \>\>\>\> \>\>\>\> Is it possible to have true give the same data as false? \>\>\>\> \>\>\>\> Best \>\>\>\> \>\>\>\> Tim \>\>\>\> \>\>\>\> On Monday, October 6, 2014 8:35:37 PM UTC+1, Tim Butler wrote: \>\>\>\>\> \>\>\>\>\> Hi Cory, \>\>\>\>\> \>\>\>\>\> I tried both options, I will try again I'm the morning. The reference \>\>\>\>\> comes from the case list api docs. \>\>\>\>\> \>\>\>\>\> Do you have a pointer on the case data api issue? \>\>\>\>\> \>\>\>\>\> Much thanks in advance \>\>\>\>\> \>\>\>\>\> Tim \>\>\>\>\> \>\>\>\>\> -- \>\>\>\> \>\>\>\> --- \>\>\>\> You received this message because you are subscribed to the Google \>\>\>\> Groups "CommCare Developers" group. \>\>\>\> To unsubscribe from this group and stop receiving emails from it, send \>\>\>\> an email to commcare-developers+unsubscribe@googlegroups.com. \>\>\>\> For more options, visit https://groups.google.com/d/optout. \>\>\>\> \>\>\> \>\>\> -- \>\> \>\> --- \>\> You received this message because you are subscribed to the Google Groups \>\> "CommCare Developers" group. \>\> To unsubscribe from this group and stop receiving emails from it, send an \>\> email to commcare-developers+unsubscribe@googlegroups.com . \>\> For more options, visit https://groups.google.com/d/optout. \>\> \> \>
