Creating cases via the API

12 views
Skip to first unread message

Douglas Aberdeen

unread,
Mar 18, 2015, 12:23:33 PM3/18/15
to commcar...@googlegroups.com
Hi Folks,

I'm scoping out using Commcare for gathering data from the field for an Indian NGO.

They'd like to use Commcare more as task based model than a case based model. I.e., predefined tasks are bulk uploaded into Commcare via the API and certain mobile users have to complete certain tasks and enter some data about that task.

I think the cases model can be adapted to this workflow, e.g., one simple case per task. But I want to check whether:

a) Does the submission API (*) support creating/modifying cases?
  This page on casexml20 suggests yes.
  The importing cases via excel page shows it is definitely possible via the CommcareHQ web portal, but we'd rather automate it by using the API.

b) If not, would it be possible to upload a form per task via the API? 
  In this case, is it possible to make some forms only visible to some users?
  After new forms are created, is it necessary to publish a new version of the app to have them picked up?

c) Any other general advice on using Commcare mobile apps as task trackers?

Thank you!
  - Doug.

(*) I'm aware that API use requires a basic software plan.

Sheel Shah

unread,
Mar 18, 2015, 1:16:26 PM3/18/15
to commcar...@googlegroups.com
Hey Doug,

You can use the submission API to create and modify cases (you just need to craft appropriate XML forms).  You can use multiple forms to create all the tasks you need (making sure you assign them to the correct users with all the correct case properties).  

Its probably easier to use the importing cases page though and it would be great if you could add a Uservoice request (dimagi.uservoice.com) to make something like that available through the API.  

Feel free to email me offline if you want to get into the technical details of how to use our submission API correctly. 

Sheel

--
You received this message because you are subscribed to the Google Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah


Douglas Aberdeen

unread,
Mar 18, 2015, 1:22:33 PM3/18/15
to commcar...@googlegroups.com
Thanks Sheel!

That's all the reassurance I needed for now.

When you say using the importing cases page through an API, do you mean something like creating an API endpoint that accepts CSV defined cases rather than XForm XML?

--
You received this message because you are subscribed to a topic in the Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commcare-users/Ia5oCXs2_WA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commcare-user...@googlegroups.com.

Sheel Shah

unread,
Mar 18, 2015, 10:48:26 PM3/18/15
to commcar...@googlegroups.com
Hey Douglas,

Yup, that's the general idea - we'll work out the details if and when we choose to build the functionality (based on the Uservoice idea).   For now the submission API is the way to achieve what you need.

Thanks,
Sheel
Reply all
Reply to author
Forward
0 new messages